diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-03-20 07:10:34 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2016-03-21 16:20:08 +0000 |
commit | 737bdea1e3dc41b5b30bb26c36224e31966ebd54 (patch) | |
tree | f1a2d013db2b7aa21c251553baae29f89712c861 /src/imports/controls/universal | |
parent | 1cec731d40f6ed8a7755c9e3c0d100afbe099ed8 (diff) |
ScrollBar: use contentItem instead of handle
Thanks to virtual resizeContent() we can finally use contentItem like
everywhere else, and cleanup the special handle item.
Change-Id: I9e52ec3ff327d19cda3d85d2e2d9b73d80442bbc
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/imports/controls/universal')
-rw-r--r-- | src/imports/controls/universal/ScrollBar.qml | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/imports/controls/universal/ScrollBar.qml b/src/imports/controls/universal/ScrollBar.qml index b1bc8f6a..393a640e 100644 --- a/src/imports/controls/universal/ScrollBar.qml +++ b/src/imports/controls/universal/ScrollBar.qml @@ -42,28 +42,22 @@ T.ScrollBar { id: control implicitWidth: Math.max(background ? background.implicitWidth : 0, - handle.implicitWidth + leftPadding + rightPadding) + contentItem.implicitWidth + leftPadding + rightPadding) implicitHeight: Math.max(background ? background.implicitHeight : 0, - handle.implicitHeight + topPadding + bottomPadding) + contentItem.implicitHeight + topPadding + bottomPadding) // TODO: arrows - //! [handle] - handle: Rectangle { + //! [contentItem] + contentItem: Rectangle { implicitWidth: 12 implicitHeight: 12 color: control.pressed ? control.Universal.baseMediumColor : control.Universal.chromeHighColor visible: control.size < 1.0 opacity: 0.0 - - readonly property bool horizontal: control.orientation === Qt.Horizontal - x: control.leftPadding + (horizontal ? control.position * control.width : 0) - y: control.topPadding + (horizontal ? 0 : control.position * control.height) - width: horizontal ? control.size * control.availableWidth : implicitWidth - height: horizontal ? implicitHeight : control.size * control.availableHeight } - //! [handle] + //! [contentItem] //! [background] background: Rectangle { @@ -86,13 +80,13 @@ T.ScrollBar { transitions: [ Transition { to: "active" - NumberAnimation { targets: [handle, background]; property: "opacity"; to: 1.0 } + NumberAnimation { targets: [contentItem, background]; property: "opacity"; to: 1.0 } }, Transition { from: "active" SequentialAnimation { PauseAnimation { duration: 3000 } - NumberAnimation { targets: [handle, background]; property: "opacity"; to: 0.0 } + NumberAnimation { targets: [contentItem, background]; property: "opacity"; to: 0.0 } } } ] |