/ widgets / StyledScrollBar.qml
StyledScrollBar.qml
 1  import "root:/services"
 2  import "root:/config"
 3  import QtQuick
 4  import QtQuick.Controls
 5  
 6  ScrollBar {
 7      id: root
 8  
 9      contentItem: StyledRect {
10          implicitWidth: 6
11          opacity: root.pressed ? 1 : root.policy === ScrollBar.AlwaysOn || (root.active && root.size < 1) ? 0.8 : 0
12          radius: Appearance.rounding.full
13          color: Colours.palette.m3secondary
14  
15          Behavior on opacity {
16              NumberAnimation {
17                  duration: Appearance.anim.durations.normal
18                  easing.type: Easing.BezierSpline
19                  easing.bezierCurve: Appearance.anim.curves.standard
20              }
21          }
22      }
23  
24      MouseArea {
25          z: -1
26          anchors.fill: parent
27          onWheel: event => {
28              if (event.angleDelta.y > 0)
29                  root.decrease();
30              else if (event.angleDelta.y < 0)
31                  root.increase();
32          }
33      }
34  }