From c5381c5194adf97c240acb98eb4c4c950633b325 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Mon, 4 Aug 2025 22:45:15 +1000 Subject: internal: refactor widgets folder Split into subdirs and rename to components --- components/controls/StyledScrollBar.qml | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 components/controls/StyledScrollBar.qml (limited to 'components/controls/StyledScrollBar.qml') diff --git a/components/controls/StyledScrollBar.qml b/components/controls/StyledScrollBar.qml new file mode 100644 index 0000000..61ddc6d --- /dev/null +++ b/components/controls/StyledScrollBar.qml @@ -0,0 +1,36 @@ +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 { + NumberAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.standard + } + } + } + + 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(); + } + } +} -- cgit v1.2.3-freya