-
Notifications
You must be signed in to change notification settings - Fork 21
fix: adjust scrollbar visibility logic #297
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 scrollbar visibility condition to properly handle AlwaysOn policy with hover/pressed states. The previous logic would show scrollbar in AlwaysOn mode even when hovered or pressed, which caused visual inconsistency. Now it only shows when not hovered and not pressed in AlwaysOn mode, while maintaining the original behavior for the moving condition. 修复滚动条可见性逻辑 修复滚动条可见性条件以正确处理 AlwaysOn 策略与悬停/按下状态。之前的逻辑 会在 AlwaysOn 模式下即使悬停或按下时也显示滚动条,这导致视觉不一致。现在 在 AlwaysOn 模式下仅在未悬停且未按下时显示,同时保持移动条件的原始行为。 Pms: BUG-332031
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
deepin pr auto review我对这段代码的修改进行审查,主要关注语法逻辑、代码质量、性能和安全性:
改进建议:
总体而言,这个修改是合理的,它改进了滚动条的显示逻辑,使其更加符合用户期望的行为。 |
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.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRefined the AlwaysOn scrollbar visibility logic to hide the scrollbar when hovered or pressed while preserving the original moving and size-based display conditions. Class diagram for updated ScrollBar state logicclassDiagram
class ScrollBar {
+policy: Policy
+active: bool
+pressed: bool
+hovered: bool
+size: float
}
class State {
+name: string
+moving: bool
+when: bool
}
ScrollBar "1" -- "*" State : has
State : when = (policy == AlwaysOn && !hovered && !pressed) || (moving && size < 1.0)
State : moving = active && !pressed && !hovered
State diagram for ScrollBar visibility logicstateDiagram-v2
[*] --> AlwaysOn
AlwaysOn --> Visible : !hovered && !pressed
AlwaysOn --> Hidden : hovered || pressed
[*] --> Moving
Moving --> Visible : active && !pressed && !hovered && size < 1.0
Visible --> [*]
Hidden --> [*]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Fixed scrollbar visibility condition to properly handle AlwaysOn policy with hover/pressed states. The previous logic would show scrollbar in AlwaysOn mode even when hovered or pressed, which caused visual inconsistency. Now it only shows when not hovered and not pressed in AlwaysOn mode, while maintaining the original behavior for the moving condition.
修复滚动条可见性逻辑
修复滚动条可见性条件以正确处理 AlwaysOn 策略与悬停/按下状态。之前的逻辑
会在 AlwaysOn 模式下即使悬停或按下时也显示滚动条,这导致视觉不一致。现在
在 AlwaysOn 模式下仅在未悬停且未按下时显示,同时保持移动条件的原始行为。
Pms: BUG-332031
Summary by Sourcery
Adjust scrollbar visibility logic to properly handle the AlwaysOn policy by only showing the scrollbar when not hovered or pressed, while preserving the original moving behavior.
Bug Fixes: