5import QtQuick.Templates as T
21 readonly property bool _visuallyExpanded: hovered || pressed || visualFocus
23 implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, implicitContentWidth + leftPadding + rightPadding)
24 implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, implicitContentHeight + topPadding + bottomPadding)
26 padding: control._visuallyExpanded ? 1 : 2
28 minimumSize: orientation === Qt.Horizontal ? height / width : width / height
31 focusPolicy: Qt.StrongFocus
33 visible: control.policy !== T.ScrollBar.AlwaysOff
35 contentItem: Rectangle {
36 implicitWidth: control._visuallyExpanded ? 6 : 2
37 implicitHeight: control._visuallyExpanded ? 6 : 2
39 color: MD.Utils.transparent(control.MD.Style.onSurfaceColor, control.pressed ? 0.8 : 0.38)
40 radius: control.orientation === Qt.Horizontal ? height / 2.0 : width / 2.0
44 background: Rectangle {
45 implicitWidth: control._visuallyExpanded ? 4 : 2
46 implicitHeight: control._visuallyExpanded ? 4 : 2
48 color: MD.Utils.transparent(control.MD.Style.onSurfaceColor, 0.12)
49 radius: control.orientation === Qt.Horizontal ? height / 2.0 : width / 2.0
51 visible: control._visuallyExpanded
57 when: control.policy === T.ScrollBar.AlwaysOn || (control.active && control.size < 1.0)
66 targets: [control.contentItem, control.background]
76 targets: [control.contentItem, control.background]
84 targets: [control.contentItem, control.background]