diff options
Diffstat (limited to 'src/imports/controls/ScrollIndicator.qml')
-rw-r--r-- | src/imports/controls/ScrollIndicator.qml | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/imports/controls/ScrollIndicator.qml b/src/imports/controls/ScrollIndicator.qml index e2fc23b1..c129e5b8 100644 --- a/src/imports/controls/ScrollIndicator.qml +++ b/src/imports/controls/ScrollIndicator.qml @@ -1,9 +1,9 @@ /**************************************************************************** ** -** Copyright (C) 2015 The Qt Company Ltd. +** Copyright (C) 2016 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** -** This file is part of the Qt Labs Controls module of the Qt Toolkit. +** This file is part of the Qt Quick Controls 2 module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL3$ ** Commercial License Usage @@ -35,20 +35,19 @@ ****************************************************************************/ import QtQuick 2.6 -import Qt.labs.templates 1.0 as T +import QtQuick.Templates 2.0 as T T.ScrollIndicator { id: control implicitWidth: Math.max(background ? background.implicitWidth : 0, - indicator.implicitWidth + leftPadding + rightPadding) + contentItem.implicitWidth + leftPadding + rightPadding) implicitHeight: Math.max(background ? background.implicitHeight : 0, - indicator.implicitHeight + topPadding + bottomPadding) + contentItem.implicitHeight + topPadding + bottomPadding) padding: 2 - //! [indicator] - indicator: Rectangle { + contentItem: Rectangle { id: indicator implicitWidth: 2 @@ -58,12 +57,6 @@ T.ScrollIndicator { 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 - states: State { name: "active" when: control.active @@ -80,5 +73,4 @@ T.ScrollIndicator { } ] } - //! [indicator] } |