-
Notifications
You must be signed in to change notification settings - Fork 55
fix: fix collapsed tray item visual index #1348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixed the visual index assignment for collapsed tray items. Previously when collapsed, collapsable items were incorrectly assigned visual index of currentVisualIndex-1, which could cause display issues. Now correctly set visual index to -1 for hidden items when tray is collapsed, ensuring proper visual representation and preventing potential rendering problems. fix: 修复折叠托盘项的可视索引 修复了折叠托盘项的可视索引分配问题。之前当托盘折叠时,可折叠项被错误地分 配了 currentVisualIndex-1 的可视索引,这可能导致显示问题。现在当托盘折叠 时,正确地将隐藏项的可视索引设置为 -1,确保正确的视觉表示并防止潜在的渲 染问题。 PMS: BUG-325429 BUG-339837
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR corrects the visual index assignment for tray items when the tray is collapsed by replacing the erroneous currentVisualIndex-1 value with -1, ensuring hidden items are properly represented and avoiding rendering glitches. Class diagram for updated TraySortOrderModel visual index logicclassDiagram
class TraySortOrderModel {
+updateVisualIndexes()
VisualIndexRole
m_collapsed : bool
results : QList<Item>
}
class Item {
+setData(value, role)
}
TraySortOrderModel --> Item
Flow diagram for visual index assignment when tray is collapsedflowchart TD
A["updateVisualIndexes() called"] --> B["Is tray collapsed? (m_collapsed)"]
B -- Yes --> C["Set visual index of collapsable items to -1 (hidden)"]
B -- No --> D["Set visual index of collapsable items to currentVisualIndex++"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- Replace the magic number -1 with a named constant (e.g. HIDDEN_VISUAL_INDEX) to clarify its purpose as the hidden-item sentinel.
- Verify that all rendering logic treats negative visual indices as hidden to ensure no unintended display issues occur downstream.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Replace the magic number -1 with a named constant (e.g. HIDDEN_VISUAL_INDEX) to clarify its purpose as the hidden-item sentinel.
- Verify that all rendering logic treats negative visual indices as hidden to ensure no unintended display issues occur downstream.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
deepin pr auto review我来对这段代码进行审查:
总体来说,这是一个很好的改进,使代码更加健壮和易于理解。修改后的逻辑更加清晰,也更符合代码的预期行为。 |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, wjyrich 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 |
Fixed the visual index assignment for collapsed tray items. Previously when collapsed, collapsable items were incorrectly assigned visual index of currentVisualIndex-1, which could cause display issues. Now correctly set visual index to -1 for hidden items when tray is collapsed, ensuring proper visual representation and preventing potential rendering problems.
fix: 修复折叠托盘项的可视索引
修复了折叠托盘项的可视索引分配问题。之前当托盘折叠时,可折叠项被错误地分
配了 currentVisualIndex-1 的可视索引,这可能导致显示问题。现在当托盘折叠
时,正确地将隐藏项的可视索引设置为 -1,确保正确的视觉表示并防止潜在的渲
染问题。
PMS: BUG-325429 BUG-339837
Summary by Sourcery
Bug Fixes: