nosignal-shell/components/controls/StyledScrollBar.qml
2025-08-24 17:22:00 +10:00

32 lines
723 B
QML

import ".."
import qs.services
import qs.config
import QtQuick
import QtQuick.Controls
ScrollBar {
id: root
contentItem: StyledRect {
implicitWidth: 6
opacity: root.pressed ? 1 : root.policy === ScrollBar.AlwaysOn || (root.active && root.size < 1) ? 0.8 : 0
radius: Appearance.rounding.full
color: Colours.palette.m3secondary
Behavior on opacity {
Anim {}
}
}
CustomMouseArea {
z: -1
anchors.fill: parent
function onWheel(event: WheelEvent): void {
if (event.angleDelta.y > 0)
root.decrease();
else if (event.angleDelta.y < 0)
root.increase();
}
}
}