Skip to content

Conversation

@18202781743
Copy link
Contributor

@18202781743 18202781743 commented Oct 23, 2025

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

Summary by Sourcery

Bug Fixes:

  • Recalculate scrollbar state on policy change to properly show or hide the scrollbar according to the policy.

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
@18202781743 18202781743 requested review from BLumia and mhduiy October 23, 2025 07:39
@sourcery-ai
Copy link

sourcery-ai bot commented Oct 23, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Added 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 change

sequenceDiagram
    participant ScrollBar
    participant Qt
    ScrollBar->>ScrollBar: policyChanged signal
    ScrollBar->>Qt: callLater(__calculateStateConditions)
    Qt-->>ScrollBar: __calculateStateConditions() executes
    ScrollBar->>ScrollBar: Recalculate scrollbar visibility state
Loading

File-Level Changes

Change Details Files
Trigger state conditions recalculation on scrollbar policy change
  • Added onPolicyChanged signal handler
  • Queued __calculateStateConditions call via Qt.callLater within the handler
qt6/src/qml/ScrollBar.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

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
Copy link

@sourcery-ai sourcery-ai bot left a 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.

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

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

@18202781743 18202781743 merged commit fcf3631 into linuxdeepin:master Oct 23, 2025
17 of 18 checks passed
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants