Skip to content

fix: resolve UI centering and alignment issues - #747

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
kt286:split/fix-centering
Aug 31, 2026
Merged

fix: resolve UI centering and alignment issues#747
deepin-bot[bot] merged 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

Improve music player layout consistency by centering UI elements and making list and playlist columns adapt to their available space.

Bug Fixes:

  • Correct UI centering and alignment for toolbar content, music-list titles, playlist rows, artist sublists, and waveform time text.
  • Prevent playlist and artist-sublist delegates from accessing unavailable model or parent data.

Enhancements:

  • Add row numbers and center favorite controls in artist sublist entries.
  • Adjust playlist and artist-sublist column sizing and delegate layout for responsive widths.

Chores:

  • Modernize several QML signal and event handler declarations and update copyright years.

@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

@kt286
kt286 force-pushed the split/fix-centering branch from f8cabfc to 9872917 Compare August 20, 2026 02:07
@lzwind

lzwind commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

代码审查反馈(V-3031)— 建议修复

数字列新增的 playActionButton 为死代码

ArtistSublistDelegate.qml 在行号列新增了 playActionButton,但 visible: false 硬编码且无 State/绑定在 hover 时显示;numLable(行号)始终可见。且 ImageCell.qml 本身已有可用的播放按钮(hover/当前播放时显示)。因此这个新按钮是冗余且不可见的死代码,playing/activeMeta 两个属性也仅服务于它。

建议:要么补全"行号→hover 显示播放键"的切换(visible: sublistDelegate.hovered,并在 hover 时隐藏 numLable),要么直接移除该按钮与两个属性。

其余改动正确:垂直居中、空安全(!mediaData / parent ? ... / get(index) ? ...)、function onSignal() 迁移、WaveformRect 误用 Text.AlignHCenter 作 verticalAlignment 的修正、列宽算式(26→56,columnMusic 同步 -30)均一致。

次要:grabToImage 用逻辑尺寸 Qt.size(w,h) 未乘 devicePixelRatio,HiDPI 下拖拽预览分辨率偏低(与 #740 一致)。

@kt286

kt286 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

代码审查反馈(V-3031)— 建议修复

数字列新增的 playActionButton 为死代码

ArtistSublistDelegate.qml 在行号列新增了 playActionButton,但 visible: false 硬编码且无 State/绑定在 hover 时显示;numLable(行号)始终可见。且 ImageCell.qml 本身已有可用的播放按钮(hover/当前播放时显示)。因此这个新按钮是冗余且不可见的死代码,playing/activeMeta 两个属性也仅服务于它。

建议:要么补全"行号→hover 显示播放键"的切换(visible: sublistDelegate.hovered,并在 hover 时隐藏 numLable),要么直接移除该按钮与两个属性。

其余改动正确:垂直居中、空安全(!mediaData / parent ? ... / get(index) ? ...)、function onSignal() 迁移、WaveformRect 误用 Text.AlignHCenter 作 verticalAlignment 的修正、列宽算式(26→56,columnMusic 同步 -30)均一致。

次要:grabToImage 用逻辑尺寸 Qt.size(w,h) 未乘 devicePixelRatio,HiDPI 下拖拽预览分辨率偏低(与 #740 一致)。

@lzwind 已删除 playActionButton 和 playing/activeMeta 两个属性

grabToImage 问题也删除了,计划未来新开个PR 单独处理这个问题

- 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中添加行号列和播放按钮居中
@lzwind
lzwind force-pushed the split/fix-centering branch from aa98b80 to 27c28f5 Compare August 31, 2026 01:04
@lzwind

lzwind commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

/forcemerge

@deepin-bot

deepin-bot Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

This pr force merged! (status: blocked)

@deepin-bot
deepin-bot Bot merged commit 9b7ccc2 into linuxdeepin:master Aug 31, 2026
13 checks passed
@kt286
kt286 deleted the split/fix-centering branch August 31, 2026 01:42
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.

3 participants