-
Notifications
You must be signed in to change notification settings - Fork 42
fix: recalculate state on scrollbar policy change #544
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 an issue where scrollbar visibility states were not properly updated when the scroll policy changed. Added a handler for the policyChanged signal to trigger state condition recalculation, ensuring the scrollbar appears/disappears correctly according to policy settings. Influence: 1. Test scrollbar visibility when changing between ScrollBar.AsNeeded, ScrollBar.AlwaysOn, and ScrollBar.AlwaysOff policies 2. Verify scrollbar appears and disappears correctly based on content size and policy settings 3. Check that scrollbar state transitions smoothly when policy changes dynamically 4. Test with different scrollbar orientations (vertical/horizontal) fix: 修复滚动条策略变更时状态未更新的问题 修复了滚动条可见性状态在滚动策略变更时未正确更新的问题。添加了对 policyChanged 信号的处理程序,触发状态条件重新计算,确保滚动条根据策略设 置正确显示/隐藏。 Influence: 1. 测试在 ScrollBar.AsNeeded、ScrollBar.AlwaysOn 和 ScrollBar.AlwaysOff 策略之间切换时的滚动条可见性 2. 验证滚动条根据内容大小和策略设置正确显示和隐藏 3. 检查策略动态变化时滚动条状态转换是否平滑 4. 测试不同滚动条方向(垂直/水平)的情况 PMS: BUG-338239
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdded onPolicyChanged handler in ScrollBar.qml to invoke deferred state condition recalculation, ensuring scrollbar visibility updates correctly when the scroll policy changes. Sequence diagram for scrollbar state recalculation on policy changesequenceDiagram
participant ScrollBar
participant Qt
ScrollBar->>ScrollBar: policyChanged signal
ScrollBar->>Qt: callLater(__calculateStateConditions)
Qt-->>ScrollBar: __calculateStateConditions() executes
ScrollBar->>ScrollBar: Recalculate scrollbar visibility state
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#544
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:
- Consider combining the onSizeChanged and onPolicyChanged handlers into a single reactive binding or helper function to avoid duplicating the Qt.callLater(__calculateStateConditions) call.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider combining the onSizeChanged and onPolicyChanged handlers into a single reactive binding or helper function to avoid duplicating the Qt.callLater(__calculateStateConditions) call.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, mhduiy 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 |
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#544
Fixed an issue where scrollbar visibility states were not properly
updated when the scroll policy changed. Added a handler for the
policyChanged signal to trigger state condition recalculation, ensuring
the scrollbar appears/disappears correctly according to policy settings.
Influence:
ScrollBar.AlwaysOn, and ScrollBar.AlwaysOff policies
size and policy settings
dynamically
fix: 修复滚动条策略变更时状态未更新的问题
修复了滚动条可见性状态在滚动策略变更时未正确更新的问题。添加了对
policyChanged 信号的处理程序,触发状态条件重新计算,确保滚动条根据策略设
置正确显示/隐藏。
Influence:
策略之间切换时的滚动条可见性
PMS: BUG-338239
Summary by Sourcery
Bug Fixes: