diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-03 12:46:40 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-03 12:46:40 +1000 |
| commit | e3a27ec90b1dd661cccff6e3036f653f8aa7b095 (patch) | |
| tree | f803145dfcfef2bb9b1c5dc276014203eada1537 /widgets/StyledScrollBar.qml | |
| parent | launcher: fix background height (diff) | |
| download | caelestia-shell-e3a27ec90b1dd661cccff6e3036f653f8aa7b095.tar.gz caelestia-shell-e3a27ec90b1dd661cccff6e3036f653f8aa7b095.tar.bz2 caelestia-shell-e3a27ec90b1dd661cccff6e3036f653f8aa7b095.zip | |
launcher: fix scrollbar
Diffstat (limited to 'widgets/StyledScrollBar.qml')
| -rw-r--r-- | widgets/StyledScrollBar.qml | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/widgets/StyledScrollBar.qml b/widgets/StyledScrollBar.qml index b341173..73b7451 100644 --- a/widgets/StyledScrollBar.qml +++ b/widgets/StyledScrollBar.qml @@ -6,25 +6,42 @@ ScrollBar { id: root contentItem: StyledRect { - opacity: 0 + opacity: root.pressed ? 0.8 : root.policy === ScrollBar.AlwaysOn || (root.active && root.size < 1) ? 0.6 : 0 radius: Appearance.rounding.full - color: Qt.alpha(Appearance.colours.m3secondary, 0.6) + color: Appearance.colours.m3secondary + + Behavior on opacity { + NumberAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.standard + } + } } background: StyledRect { implicitWidth: 10 - opacity: 0 + opacity: root.policy === ScrollBar.AlwaysOn || (root.active && root.size < 1) ? 0.4 : 0 radius: Appearance.rounding.full - color: Qt.alpha(Appearance.colours.m3surfaceContainerLow, 0.4) + color: Appearance.colours.m3surfaceContainerLow - MouseArea { - anchors.fill: parent - onWheel: event => { - if (event.angleDelta.y > 0) - root.decrease(); - else if (event.angleDelta.y < 0) - root.increase(); + Behavior on opacity { + NumberAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.standard } } } + + MouseArea { + z: -1 + anchors.fill: parent + onWheel: event => { + if (event.angleDelta.y > 0) + root.decrease(); + else if (event.angleDelta.y < 0) + root.increase(); + } + } } |