Skip to content

fix: correct task manager space calculation for window split mode#1655

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

fix: correct task manager space calculation for window split mode#1655
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
52cyb:master

Conversation

@52cyb

@52cyb 52cyb commented Jun 30, 2026

Copy link
Copy Markdown
Contributor
  1. Refactored remainingSpacesForTaskManager from a readonly property to a function calcRemainingSpace(baseSize) for reuse with dynamic base size
  2. Updated TextCalculator to use dockSize instead of dockItemMaxSize for icon size, ensuring consistency with actual dock state
  3. Fixed TextCalculator.spacing to be computed from icon size, matching updated visual requirements
  4. Redefined remainingSpace in TextCalculator to use the new function with proper start padding calculation, accounting for multitask view icon ratio
  5. Added proper start padding formula to balance visual gaps between multitask icon and first app icon

Log: Optimized task space calculation for window split mode layouts

Influence:

  1. Test dock in bottom/top positions with window split mode enabled
  2. Verify app icon sizes and spacing appear proportional to dock size
  3. Check remaining space calculation when other dock center items exist
  4. Validate visual gap between multitask icon and first app icon matches appTitleSpacing
  5. Test with varying screen resolutions and dock scaling (dockSize changes)
  6. Verify no regressions when window split mode is disabled

fix: 修正窗口分屏模式下任务管理器空间计算

  1. remainingSpacesForTaskManager 从只读属性重构为函数 calcRemainingSpace(baseSize),支持动态基础大小复用
  2. 更新 TextCalculator 使用 dockSize 而非 dockItemMaxSize 计算图标 大小,确保与实际停靠栏状态一致
  3. 修正 TextCalculator.spacing 根据图标大小计算,匹配更新后的视觉需求
  4. 重新定义 TextCalculator 中的 remainingSpace,使用新函数并加入正确 的起始填充计算,考虑多任务视图图标比例
  5. 添加正确的起始填充公式,平衡多任务图标与首个应用图标之间的视觉间距

Log: 优化窗口分屏模式下任务栏空间计算

Influence:

  1. 在底部/顶部位置并启用窗口分屏模式下测试停靠栏
  2. 验证应用图标大小和间距是否与停靠栏大小成比例
  3. 当存在其他停靠栏中心项时检查剩余空间计算
  4. 验证多任务图标与首个应用图标之间的视觉间距是否匹配 appTitleSpacing
  5. 使用不同屏幕分辨率和停靠栏缩放(dockSize 变化)进行测试
  6. 验证禁用窗口分屏模式时没有回归问题

PMS: BUG-368031

Summary by Sourcery

Adjust task manager space and icon calculations to align dock layout with window split mode visuals.

New Features:

  • Support dynamic base size calculation for remaining dock center space via a reusable calcRemainingSpace function.

Bug Fixes:

  • Correct remaining space computation for the task manager when other dock center items are present, using proper icon ratio and start padding.
  • Fix icon size and spacing calculations in TextCalculator to be proportional to the current dock size and multitask icon ratio.

Enhancements:

  • Refine start padding and app title spacing to maintain consistent visual gaps between the multitask icon and the first app icon across dock positions.

1. Refactored `remainingSpacesForTaskManager` from a readonly property
to a function `calcRemainingSpace(baseSize)` for reuse with dynamic
base size
2. Updated `TextCalculator` to use `dockSize` instead of
`dockItemMaxSize` for icon size, ensuring consistency with actual dock
state
3. Fixed `TextCalculator.spacing` to be computed from icon size,
matching updated visual requirements
4. Redefined `remainingSpace` in `TextCalculator` to use the new
function with proper start padding calculation, accounting for multitask
view icon ratio
5. Added proper start padding formula to balance visual gaps between
multitask icon and first app icon

Log: Optimized task space calculation for window split mode layouts

Influence:
1. Test dock in bottom/top positions with window split mode enabled
2. Verify app icon sizes and spacing appear proportional to dock size
3. Check remaining space calculation when other dock center items exist
4. Validate visual gap between multitask icon and first app icon matches
`appTitleSpacing`
5. Test with varying screen resolutions and dock scaling (dockSize
changes)
6. Verify no regressions when window split mode is disabled

fix: 修正窗口分屏模式下任务管理器空间计算

1. 将 `remainingSpacesForTaskManager` 从只读属性重构为函数
`calcRemainingSpace(baseSize)`,支持动态基础大小复用
2. 更新 `TextCalculator` 使用 `dockSize` 而非 `dockItemMaxSize` 计算图标
大小,确保与实际停靠栏状态一致
3. 修正 `TextCalculator.spacing` 根据图标大小计算,匹配更新后的视觉需求
4. 重新定义 `TextCalculator` 中的 `remainingSpace`,使用新函数并加入正确
的起始填充计算,考虑多任务视图图标比例
5. 添加正确的起始填充公式,平衡多任务图标与首个应用图标之间的视觉间距

Log: 优化窗口分屏模式下任务栏空间计算

Influence:
1. 在底部/顶部位置并启用窗口分屏模式下测试停靠栏
2. 验证应用图标大小和间距是否与停靠栏大小成比例
3. 当存在其他停靠栏中心项时检查剩余空间计算
4. 验证多任务图标与首个应用图标之间的视觉间距是否匹配 `appTitleSpacing`
5. 使用不同屏幕分辨率和停靠栏缩放(dockSize 变化)进行测试
6. 验证禁用窗口分屏模式时没有回归问题

PMS: BUG-368031
@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

sourcery-ai Bot commented Jun 30, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Refactors the task manager’s remaining space calculation to be reusable with dynamic dock sizes and updates TextCalculator to derive icon sizing, spacing, and start padding from the actual dock size so that window split mode layouts have proportional spacing and correct visual gaps.

File-Level Changes

Change Details Files
Refactor remaining space calculation into a reusable function and keep the original readonly property as a wrapper.
  • Replaced readonly property logic with a calcRemainingSpace(baseSize) function scoped to the TaskManager containment item.
  • Adjusted ‘otherOccupied’ computation to use the provided baseSize and multitaskViewIconRatio instead of dockItemMaxSize * 0.8.
  • Reintroduced remainingSpacesForTaskManager as a readonly property that calls calcRemainingSpace with Panel.rootObject.dockItemMaxSize.
panels/dock/taskmanager/package/TaskManager.qml
Update TextCalculator sizing and spacing to be based on the actual dock size and icon size rather than static max size and external spacing.
  • Changed iconSize to be derived from Panel.rootObject.dockSize * 9 / 14 instead of dockItemMaxSize.
  • Recomputed spacing as a function of textCalculator.iconSize using a clamped Math.max/round formula.
  • Set cellSize and itemPadding to continue using textCalculator.iconSize for layout consistency.
panels/dock/taskmanager/package/TaskManager.qml
Redefine remainingSpace in TextCalculator to use the new calcRemainingSpace function with a corrected start padding formula that accounts for multitask icon ratio.
  • Replaced remainingSpace expression with a block that derives dockIconSize from Panel.rootObject.dockSize.
  • Computed startPadding using spacing minus an adjustment based on dockIconSize, multitaskViewIconRatio, and iconWidthToMaxSizeRatio, clamped at zero.
  • Used calcRemainingSpace(dockIconSize) minus startPadding to determine remainingSpace, aligning spacing with multitask icon and first app icon visual gap.
panels/dock/taskmanager/package/TaskManager.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

@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.

Hey - I've left some high level feedback:

  • The new calcRemainingSpace(baseSize) still uses dockItemMaxSize for remainingSpacesForTaskManager while TextCalculator now uses dockSize; consider aligning these base sizes or documenting why they differ to avoid subtle layout inconsistencies.
  • The start padding computation in TextCalculator.remainingSpace introduces a new formula using multitaskViewIconRatio and iconWidthToMaxSizeRatio; it may be clearer and less error-prone to factor this into a named helper or constant so the visual rationale is easier to maintain.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `calcRemainingSpace(baseSize)` still uses `dockItemMaxSize` for `remainingSpacesForTaskManager` while `TextCalculator` now uses `dockSize`; consider aligning these base sizes or documenting why they differ to avoid subtle layout inconsistencies.
- The start padding computation in `TextCalculator.remainingSpace` introduces a new formula using `multitaskViewIconRatio` and `iconWidthToMaxSizeRatio`; it may be clearer and less error-prone to factor this into a named helper or constant so the visual rationale is easier to maintain.

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.

@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

52cyb commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-bot

deepin-bot Bot commented Jun 30, 2026

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot deepin-bot Bot merged commit 918c134 into linuxdeepin:master Jun 30, 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