Skip to content

Commit 52b255f

Browse files
wjyrich18202781743
authored andcommitted
fix: adjust scrollbar visibility conditions
Fixed scrollbar visibility logic to properly handle AlwaysOn policy with hover/pressed states. The original condition would show scrollbar in AlwaysOn mode even when hovered or pressed, which caused visual inconsistency. Now the scrollbar only shows in AlwaysOn mode when not hovered and not pressed, maintaining consistent behavior with other states. fix: 调整滚动条可见性条件 修复滚动条可见性逻辑以正确处理 AlwaysOn 策略与悬停/按下状态。原始条件会 在 AlwaysOn 模式下即使悬停或按下时也显示滚动条,这导致视觉不一致。现在 滚动条仅在未悬停且未按下时的 AlwaysOn 模式下显示,保持与其他状态一致的 行为。 Pms: BUG-332031
1 parent c56e04e commit 52b255f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

qt6/src/qml/ScrollBar.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,23 +31,23 @@ T.ScrollBar {
3131
State {
3232
name: "normal"
3333
property bool moving: control.active && !control.pressed && !control.hovered
34-
when: control.policy === T.ScrollBar.AlwaysOn || ( moving && control.size < 1.0)
34+
when: (control.policy === T.ScrollBar.AlwaysOn && !control.hovered && !control.pressed) || (moving && control.size < 1.0)
3535
PropertyChanges {
3636
target: control.contentItem
3737
implicitWidth: DS.Style.scrollBar.width
3838
}
3939
},
4040
State {
4141
name: "hover"
42-
when: control.policy === T.ScrollBar.AlwaysOn || ( control.hovered && !control.pressed && control.size < 1.0)
42+
when: (control.hovered && !control.pressed && control.size < 1.0)
4343
PropertyChanges {
4444
target: control.contentItem
4545
implicitWidth: DS.Style.scrollBar.activeWidth
4646
}
4747
},
4848
State {
4949
name: "active"
50-
when: control.policy === T.ScrollBar.AlwaysOn || (control.pressed && control.size < 1.0)
50+
when: (control.pressed && control.size < 1.0)
5151
PropertyChanges {
5252
target: control.contentItem
5353
implicitWidth: DS.Style.scrollBar.activeWidth

0 commit comments

Comments
 (0)