Skip to content

fix: resolve UI centering and alignment issues - #747

Open
kt286 wants to merge 1 commit into
linuxdeepin:masterfrom
kt286:split/fix-centering
Open

fix: resolve UI centering and alignment issues#747
kt286 wants to merge 1 commit into
linuxdeepin:masterfrom
kt286:split/fix-centering

Conversation

@kt286

@kt286 kt286 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
  • Fix vertical centering of title column and time text in Toolbar
  • Add vertical alignment to title label in AllMusicListDelegate
  • Fix playlist delegate horizontal centering and dynamic width in CurrentPlayList
  • Adjust header column width and title offset in ArtistSublistView
  • Fix text vertical centering in WaveformRect
  • Add row number column and play button centering in ArtistSublistDelegate

fix: 解决UI居中和对齐问题

  • 修复工具栏标题列和时间文本的垂直居中
  • 在AllMusicListDelegate中为标题标签添加垂直对齐
  • 修复播放列表委托的水平居中和动态宽度
  • 调整ArtistSublistView中的标题列宽度和偏移
  • 修复WaveformRect中的文本垂直居中
  • 在ArtistSublistDelegate中添加行号列和播放按钮居中

Summary by Sourcery

Fix UI alignment and sizing across toolbars, playlists, music lists, and artist sublists.

New Features:

  • Add row numbers and centered playback controls to artist sublist entries.

Bug Fixes:

  • Correct vertical text alignment across the toolbar, music lists, and waveform time display.
  • Fix playlist delegate sizing and centering to adapt to the playlist width.
  • Align artist sublist headers and entries with the updated column layout.
  • Guard playlist and playback state access when related data is unavailable.

Enhancements:

  • Improve drag-image sizing for music and artist list delegates.

Chores:

  • Modernize several QML signal and event handler declarations.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kt286

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot

Copy link
Copy Markdown

Hi @kt286. Thanks for your PR.

I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @kt286, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@sourcery-ai

sourcery-ai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR refines multiple QML delegates and views to fix vertical and horizontal centering issues, align text and controls consistently, and make playlist item widths responsive while adding a numbered column and play button behavior to the artist sublist.

Sequence diagram for ArtistSublistDelegate play button behavior

sequenceDiagram
    actor User
    participant ArtistSublistDelegate
    participant Presenter

    User ->> ArtistSublistDelegate: onClicked (playActionButton)
    alt [playing && activeMeta]
        ArtistSublistDelegate ->> Presenter: pause()
    else [not playing || not activeMeta]
        ArtistSublistDelegate ->> Presenter: playArtist(artist, hash)
    end
Loading

File-Level Changes

Change Details Files
Add numbered column and centered play/favorite controls to artist sublist rows, and align header/columns accordingly.
  • Import audio.global and add playing/activeMeta state properties based on globalVariant
  • Adjust dragDelegate.grabToImage to specify the snapshot size
  • Replace the leading 26px column with a 56px row containing a numeric label and a play ActionButton that reflects playing and selection state
  • Move the favorite (heart) ActionButton into its own 20px column and center it vertically
  • Recalculate the title/music column width to account for the new number and right-side columns
  • Update ArtistSublistView header first column width to 56px and title column width/left padding to match the delegate layout
  • Guard ArtistSublistDelegate horizontalCenter anchoring and checked binding against null parent/model entries
  • Convert onWheel and onClearSelectGroup signal handlers to the function syntax required by newer QML versions
src/music-player/musicsublist/ArtistSublistDelegate.qml
src/music-player/musicsublist/ArtistSublistView.qml
Fix toolbar title/artist vertical centering and time text alignment, including null-safety for play mode changes.
  • Center the title/artist Column vertically within its 40px row and slightly tweak text formatting
  • Add verticalAlignment: Qt.AlignVCenter to currentTimeText and totalTimeText for proper vertical centering
  • Make onPlayModeChanged null-safe by checking mediaData before accessing hash
src/music-player/mainwindow/Toolbar.qml
Make current playlist delegate width responsive and horizontally centered, and correctly handle playlist hide animation signal.
  • Change CurrentPlayListDelegate width to track playlistView.width - 20 and center it horizontally instead of using a fixed width and left margin
  • Add a small footer item for spacing at the bottom of the playlist view
  • Update playlistHideAnimation.onStopped handler to the function syntax required by newer QML versions
src/music-player/playlist/CurrentPlayList.qml
Improve drag image sizing and title label vertical alignment in the all-music list delegate.
  • Call dragDelegate.grabToImage with an explicit Qt.size(dragDelegate.width, dragDelegate.height) instead of relying on default or commented-out DPI scaling
  • Add verticalAlignment: Qt.AlignVCenter to the title Label while keeping its verticalCenter anchor to the image cell
src/music-player/musicList/AllMusicListDelegate.qml
Vertically center the scrubber time text inside the waveform tooltip rectangle.
  • Give timeText a height relative to the parent and anchor it vertically centered within the tooltip rectangle
  • Remove the incorrect verticalAlignment: Text.AlignHCenter setting, relying on anchors for centering instead
src/music-player/toolbar/WaveformRect.qml

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@kt286
kt286 force-pushed the split/fix-centering branch 4 times, most recently from 163cbd0 to 00bb4b9 Compare August 11, 2026 01:00
@deepin-bot

deepin-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 7.0.63
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #762

@deepin-bot

deepin-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 7.0.64
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #765

@kt286
kt286 force-pushed the split/fix-centering branch from 00bb4b9 to f8cabfc Compare August 18, 2026 05:27
@deepin-bot

deepin-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 7.0.65
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #768

@deepin-bot

deepin-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

TAG Bot

New tag: 7.0.66
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #779

- Fix vertical centering of title column and time text in Toolbar
- Add vertical alignment to title label in AllMusicListDelegate
- Fix playlist delegate horizontal centering and dynamic width in CurrentPlayList
- Adjust header column width and title offset in ArtistSublistView
- Fix text vertical centering in WaveformRect
- Add row number column and play button centering in ArtistSublistDelegate

fix: 解决UI居中和对齐问题

- 修复工具栏标题列和时间文本的垂直居中
- 在AllMusicListDelegate中为标题标签添加垂直对齐
- 修复播放列表委托的水平居中和动态宽度
- 调整ArtistSublistView中的标题列宽度和偏移
- 修复WaveformRect中的文本垂直居中
- 在ArtistSublistDelegate中添加行号列和播放按钮居中
@kt286
kt286 force-pushed the split/fix-centering branch from f8cabfc to 9872917 Compare August 20, 2026 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants