Skip to content

fix(dock): fix premature icon label compression in taskbar#1595

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
52cyb:master
May 13, 2026
Merged

fix(dock): fix premature icon label compression in taskbar#1595
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
52cyb:master

Conversation

@52cyb
Copy link
Copy Markdown
Contributor

@52cyb 52cyb commented May 13, 2026

Use iconSize instead of maxSize to calculate other items' occupied space, and remove overly aggressive implicit size constraints that shrink task items before the taskbar is actually full.

使用图标尺寸而非最大尺寸计算其他项占用空间,移除过度限制
隐式大小的约束,避免任务栏未满时就开始压缩图标标签。

Log: 修复任务栏未满时图标标签被过早压缩的问题
PMS: 358915
Influence: 1.打开多个应用时,任务栏要占满时再开始挤压应用标签;2.相邻应用标签的文案和背景不重叠;3.应用程序过多时,应用图标会溢出任务栏中间区域,后期考虑溢出处理方案。

Summary by Sourcery

Adjust dock taskbar layout calculations to prevent premature compression of app labels and ensure space is based on actual icon sizes.

Bug Fixes:

  • Base task label cell size and padding on the calculated icon size to avoid early text squeezing.
  • Remove overly aggressive implicit size constraints on task items so they only shrink when the taskbar is actually full.
  • Use the actual dock item icon size, rather than the maximum size, when computing other items' occupied space in the dock.

Enhancements:

  • Align task item icon size handling by switching the AppItem iconSize property to a real value for more precise layout calculations.

@deepin-ci-robot
Copy link
Copy Markdown

Hi @52cyb. Thanks for your PR. 😃

@deepin-ci-robot
Copy link
Copy Markdown

Hi @52cyb. 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
Copy link
Copy Markdown

sourcery-ai Bot commented May 13, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjusts taskbar task item layout sizing so that text labels are only compressed when the taskbar is actually full, by basing space calculations on icon size and removing overly aggressive implicit size constraints.

File-Level Changes

Change Details Files
Base layout spacing and cell sizing on the calculated icon size rather than static configuration values.
  • Use textCalculator.iconSize for cellSize instead of visualModel.cellWidth in the task text layout.
  • Derive itemPadding from textCalculator.iconSize (iconSize / 8, rounded) instead of taskmanager.appTitleSpacing.
  • Change AppItem.iconSize type from int to real to support fractional sizing math.
panels/dock/taskmanager/package/TaskManager.qml
panels/dock/taskmanager/package/AppItem.qml
Remove pre-emptive implicit width/height clamping that compressed task items before the taskbar was full.
  • Simplify implicitWidth to choose between taskmanager.implicitWidth and appItem.implicitWidth based on useColumnLayout without additional max-width computation.
  • Simplify implicitHeight to choose between visualModel.cellWidth and taskmanager.implicitHeight based on useColumnLayout without additional max-height computation.
panels/dock/taskmanager/package/TaskManager.qml
Use actual icon size rather than max item size when computing space occupied by non-task items in the dock.
  • Replace dockItemMaxSize with dockItemIconSize in the otherOccupied width calculation to more accurately reflect real occupied space when determining remaining taskbar space.
panels/dock/package/main.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

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Now that itemPadding is derived from textCalculator.iconSize / 8 instead of taskmanager.appTitleSpacing, double-check that any other spacing logic (e.g., title spacing or remaining-space calculations) still yields visually consistent gaps between items and titles in both orientations.
  • By removing the implicit width/height clamping based on remainingSpacesForTaskManager, very full taskbars may now allow items to overflow; consider adding a follow-up layout safeguard (e.g., overflow handling or max width per item) so the UI degrades gracefully before a future dedicated overflow solution is implemented.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Now that `itemPadding` is derived from `textCalculator.iconSize / 8` instead of `taskmanager.appTitleSpacing`, double-check that any other spacing logic (e.g., title spacing or remaining-space calculations) still yields visually consistent gaps between items and titles in both orientations.
- By removing the implicit width/height clamping based on `remainingSpacesForTaskManager`, very full taskbars may now allow items to overflow; consider adding a follow-up layout safeguard (e.g., overflow handling or max width per item) so the UI degrades gracefully before a future dedicated overflow solution is implemented.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Use iconSize instead of maxSize to calculate other items' occupied
space, and remove overly aggressive implicit size constraints that
shrink task items before the taskbar is actually full.

使用图标尺寸而非最大尺寸计算其他项占用空间,移除过度限制
隐式大小的约束,避免任务栏未满时就开始压缩图标标签。

Log: 修复任务栏未满时图标标签被过早压缩的问题
PMS: 358915
Influence: 1.打开多个应用时,任务栏要占满时再开始挤压应用标签;2.相邻应用标签的文案和背景不重叠;3.应用程序过多时,应用图标会溢出任务栏中间区域,后期考虑溢出处理方案。
cellSize: visualModel.cellWidth
itemPadding: taskmanager.appTitleSpacing
cellSize: textCalculator.iconSize
itemPadding: Math.round(textCalculator.iconSize / 8)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Math.round(textCalculator.iconSize / 8) 这个是有特殊含义么?如果这样设置的话,qml中的布局,跟c++里的计算不一致了吧,之前都是用taskmanager.appTitleSpacing

@deepin-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, 52cyb

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

@52cyb
Copy link
Copy Markdown
Contributor Author

52cyb commented May 13, 2026

/merge

@deepin-bot
Copy link
Copy Markdown

deepin-bot Bot commented May 13, 2026

This pr cannot be merged! (status: blocked)

@52cyb
Copy link
Copy Markdown
Contributor Author

52cyb commented May 13, 2026

/forcemerge

@deepin-bot
Copy link
Copy Markdown

deepin-bot Bot commented May 13, 2026

This pr force merged! (status: blocked)

@deepin-bot deepin-bot Bot merged commit 21226d7 into linuxdeepin:master May 13, 2026
7 checks passed
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