fix: correct task manager space calculation for window split mode#1655
Conversation
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
|
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 Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRefactors 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
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The new
calcRemainingSpace(baseSize)still usesdockItemMaxSizeforremainingSpacesForTaskManagerwhileTextCalculatornow usesdockSize; consider aligning these base sizes or documenting why they differ to avoid subtle layout inconsistencies. - The start padding computation in
TextCalculator.remainingSpaceintroduces a new formula usingmultitaskViewIconRatioandiconWidthToMaxSizeRatio; 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.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
remainingSpacesForTaskManagerfrom a readonly property to a functioncalcRemainingSpace(baseSize)for reuse with dynamic base sizeTextCalculatorto usedockSizeinstead ofdockItemMaxSizefor icon size, ensuring consistency with actual dock stateTextCalculator.spacingto be computed from icon size, matching updated visual requirementsremainingSpaceinTextCalculatorto use the new function with proper start padding calculation, accounting for multitask view icon ratioLog: Optimized task space calculation for window split mode layouts
Influence:
appTitleSpacingfix: 修正窗口分屏模式下任务管理器空间计算
remainingSpacesForTaskManager从只读属性重构为函数calcRemainingSpace(baseSize),支持动态基础大小复用TextCalculator使用dockSize而非dockItemMaxSize计算图标 大小,确保与实际停靠栏状态一致TextCalculator.spacing根据图标大小计算,匹配更新后的视觉需求TextCalculator中的remainingSpace,使用新函数并加入正确 的起始填充计算,考虑多任务视图图标比例Log: 优化窗口分屏模式下任务栏空间计算
Influence:
appTitleSpacingPMS: BUG-368031
Summary by Sourcery
Adjust task manager space and icon calculations to align dock layout with window split mode visuals.
New Features:
Bug Fixes:
Enhancements: