diff options
Diffstat (limited to 'src/imports/controls/universal/ProgressBar.qml')
-rw-r--r-- | src/imports/controls/universal/ProgressBar.qml | 46 |
1 files changed, 16 insertions, 30 deletions
diff --git a/src/imports/controls/universal/ProgressBar.qml b/src/imports/controls/universal/ProgressBar.qml index 3d88fc67..66d1aeb8 100644 --- a/src/imports/controls/universal/ProgressBar.qml +++ b/src/imports/controls/universal/ProgressBar.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,47 +35,34 @@ ****************************************************************************/ import QtQuick 2.6 -import Qt.labs.templates 1.0 as T -import Qt.labs.controls.universal 1.0 -import Qt.labs.controls.universal.impl 1.0 +import QtQuick.Templates 2.0 as T +import QtQuick.Controls.Universal 2.0 +import QtQuick.Controls.Universal.impl 2.0 T.ProgressBar { id: control implicitWidth: Math.max(background ? background.implicitWidth : 0, - indicator ? indicator.implicitWidth : 0) + leftPadding + rightPadding + contentItem.implicitWidth + leftPadding + rightPadding) implicitHeight: Math.max(background ? background.implicitHeight : 0, - indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding + contentItem.implicitHeight + topPadding + bottomPadding) - //! [indicator] - indicator: Rectangle { - x: control.leftPadding - y: control.topPadding + (control.availableHeight - height) / 2 - width: control.indeterminate ? 0 : control.position * control.availableWidth - height: 10 + contentItem: ProgressStrip { + id: strip + implicitHeight: 10 scale: control.mirrored ? -1 : 1 + indeterminate: control.indeterminate color: control.Universal.accent + progress: control.position + clip: control.indeterminate - ProgressStrip { - id: strip - - width: control.availableWidth - height: control.availableHeight - - clip: control.indeterminate - visible: control.indeterminate - color: control.Universal.accent - - ProgressStripAnimator { - target: strip - running: strip.visible - } + ProgressStripAnimator { + target: strip + running: control.visible && control.indeterminate } } - //! [indicator] - //! [background] background: Rectangle { implicitWidth: 100 implicitHeight: 10 @@ -88,5 +75,4 @@ T.ProgressBar { visible: !control.indeterminate color: control.Universal.baseLowColor } - //! [background] } |