C++ / fmt (pull_request) Failing after 5s
C++ / build (pull_request) Failing after 10s
C++ / clang-tidy (pull_request) Failing after 11s
JS/TS / fmt (pull_request) Successful in 9s
JS/TS / lint (pull_request) Successful in 10s
Python / static (pull_request) Successful in 34s
Rust / build (pull_request) Successful in 59s
Python / verify (pull_request) Successful in 1m48s
Rust / fmt (pull_request) Successful in 47s
Rust / clippy (pull_request) Successful in 1m6s
64 lines
1.6 KiB
QML
64 lines
1.6 KiB
QML
import QtQuick
|
|
import ZShell.Config
|
|
import qs.Services
|
|
|
|
Item {
|
|
id: track
|
|
|
|
required property var scrollBar
|
|
required property CustomMouseArea mouseArea
|
|
|
|
anchors.bottom: parent.bottom
|
|
anchors.right: parent.right
|
|
anchors.top: parent.top
|
|
implicitWidth: Tokens.padding.extraSmall * 2
|
|
|
|
CustomClippingRect {
|
|
anchors.bottom: parent.bottom
|
|
anchors.right: parent.right
|
|
anchors.top: parent.top
|
|
radius: Tokens.rounding.full
|
|
implicitWidth: handle.implicitWidth
|
|
|
|
CustomRect {
|
|
id: handle
|
|
|
|
color: Colors.palette.m3secondary
|
|
implicitHeight: track.scrollBar.height * track.scrollBar.effectiveSize
|
|
implicitWidth: track.mouseArea.pressed || track.mouseArea.containsMouse ? Tokens.padding.extraSmall * 2 : Tokens.padding.extraSmall
|
|
anchors.right: parent.right
|
|
opacity: {
|
|
if (!track.scrollBar.enabled)
|
|
return 0;
|
|
if (track.scrollBar.size === 1)
|
|
return 0;
|
|
if (track.mouseArea.pressed)
|
|
return 1;
|
|
if (track.mouseArea.containsMouse)
|
|
return 0.8;
|
|
if (track.scrollBar.policy === CustomScrollBar.AlwaysOn || track.scrollBar.shouldBeActive)
|
|
return 0.6;
|
|
return 0;
|
|
}
|
|
radius: Tokens.rounding.full
|
|
y: track.scrollBar.reversed ? track.scrollBar.height * (1 + track.scrollBar.nonAnimY) * track.scrollBar.travelScale : track.scrollBar.height * track.scrollBar.nonAnimY * track.scrollBar.travelScale
|
|
|
|
Behavior on implicitWidth {
|
|
Anim {}
|
|
}
|
|
Behavior on opacity {
|
|
Anim {
|
|
type: Anim.DefaultEffects
|
|
}
|
|
}
|
|
|
|
MouseArea {
|
|
acceptedButtons: Qt.NoButton
|
|
anchors.fill: parent
|
|
cursorShape: Qt.PointingHandCursor
|
|
hoverEnabled: true
|
|
}
|
|
}
|
|
}
|
|
}
|