diff options
Diffstat (limited to 'src/imports/controls/universal/ScrollIndicator.qml')
-rw-r--r-- | src/imports/controls/universal/ScrollIndicator.qml | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/src/imports/controls/universal/ScrollIndicator.qml b/src/imports/controls/universal/ScrollIndicator.qml index 5787b60a..ce289ce3 100644 --- a/src/imports/controls/universal/ScrollIndicator.qml +++ b/src/imports/controls/universal/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,19 +35,20 @@ ****************************************************************************/ import QtQuick 2.6 -import Qt.labs.templates 1.0 as T -import Qt.labs.controls.universal 1.0 +import QtQuick.Templates 2.0 as T +import QtQuick.Controls.Universal 2.0 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) + + contentItem: Rectangle { + id: indicator - //! [indicator] - indicator: Rectangle { implicitWidth: 6 implicitHeight: 6 @@ -55,12 +56,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" @@ -82,5 +77,4 @@ T.ScrollIndicator { } ] } - //! [indicator] } |