fix: recalculate state on scrollbar policy change#544
Merged
18202781743 merged 1 commit intolinuxdeepin:masterfrom Oct 23, 2025
Merged
fix: recalculate state on scrollbar policy change#54418202781743 merged 1 commit intolinuxdeepin:masterfrom
18202781743 merged 1 commit intolinuxdeepin:masterfrom
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
|
deepin-ci-robot
added a commit
to linuxdeepin/dtk6declarative
that referenced
this pull request
Oct 23, 2025
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#544
There was a problem hiding this comment.
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.
mhduiy
approved these changes
Oct 23, 2025
Contributor
|
[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 |
18202781743
pushed a commit
to linuxdeepin/dtk6declarative
that referenced
this pull request
Oct 23, 2025
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#544
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: