fix: adjust scrollbar visibility logic#297
Closed
wjyrich wants to merge 1 commit intolinuxdeepin:masterfrom
Closed
fix: adjust scrollbar visibility logic#297wjyrich wants to merge 1 commit intolinuxdeepin:masterfrom
wjyrich wants to merge 1 commit intolinuxdeepin:masterfrom
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
Contributor
|
[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 |
Contributor
deepin pr auto review我对这段代码的修改进行审查,主要关注语法逻辑、代码质量、性能和安全性:
改进建议:
总体而言,这个修改是合理的,它改进了滚动条的显示逻辑,使其更加符合用户期望的行为。 |
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
|
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 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: