From fdd41317118cd14fdab472a60ac67516d9d4d937 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 19 Jan 2017 14:31:54 +0100 Subject: Add ScrollBar::interactive [ChangeLog][Controls][ScrollBar] Added an interactive-property. A non-interactive ScrollBar is visually and behaviorally similar to ScrollIndicator. This property is useful for switching between typical mouse- and touch-orientated UIs with interactive and non- interactive scroll bars, respectively. Change-Id: Ie98bfa0b5bba94a9751baf3c65f17b850b58fd1f Reviewed-by: Mitch Curtis --- src/imports/controls/material/ScrollBar.qml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/imports/controls/material/ScrollBar.qml') diff --git a/src/imports/controls/material/ScrollBar.qml b/src/imports/controls/material/ScrollBar.qml index 140cb94d..5993ab58 100644 --- a/src/imports/controls/material/ScrollBar.qml +++ b/src/imports/controls/material/ScrollBar.qml @@ -46,25 +46,26 @@ T.ScrollBar { implicitHeight: Math.max(background ? background.implicitHeight : 0, contentItem.implicitHeight + topPadding + bottomPadding) - padding: 1 + padding: control.interactive ? 1 : 2 contentItem: Rectangle { id: handle - implicitWidth: 13 - implicitHeight: 13 + implicitWidth: control.interactive ? 13 : 4 + implicitHeight: control.interactive ? 13 : 4 color: control.pressed ? control.Material.scrollBarPressedColor : - control.hovered ? control.Material.scrollBarHoveredColor : control.Material.scrollBarColor + control.interactive && control.hovered ? control.Material.scrollBarHoveredColor : control.Material.scrollBarColor visible: control.size < 1.0 opacity: 0.0 } background: Rectangle { - implicitWidth: 16 - implicitHeight: 16 + implicitWidth: control.interactive ? 16 : 4 + implicitHeight: control.interactive ? 16 : 4 color: "#0e000000" opacity: 0.0 + visible: control.interactive } states: State { -- cgit v1.2.3