diff --git a/examples/touch/content/ProgressBarPage.qml b/examples/touch/content/ProgressBarPage.qml index f19fe6f..7be92d2 100644 --- a/examples/touch/content/ProgressBarPage.qml +++ b/examples/touch/content/ProgressBarPage.qml @@ -82,28 +82,9 @@ Page { ProgressBar { anchors.margins: 20 - style: touchStyle - value: 1 + indeterminate: true + value: 0.85 width: 400 } } - - Component { - id: touchStyle - ProgressBarStyle { - panel: Rectangle { - implicitHeight: 15 - implicitWidth: 400 - color: "#444" - opacity: 0.8 - Rectangle { - antialiasing: true - radius: 1 - color: "#468bb7" - height: parent.height - width: parent.width * control.value / control.maximumValue - } - } - } - } } diff --git a/src/controls/controls.pro b/src/controls/controls.pro index 555f5ba..1ddad92 100644 --- a/src/controls/controls.pro +++ b/src/controls/controls.pro @@ -15,6 +15,7 @@ QML_FILES += \ qml/Checkbox.qml\ qml/ButtonRow.qml \ qml/Header.qml \ + qml/ProgressBar.qml \ qml/HeaderToolsLayout.qml \ qml/Slider.qml\ qml/ListView.qml \ diff --git a/src/controls/qml/ProgressBar.qml b/src/controls/qml/ProgressBar.qml new file mode 100644 index 0000000..6597dbc --- /dev/null +++ b/src/controls/qml/ProgressBar.qml @@ -0,0 +1,7 @@ +import QtQuick 2.6 +import QtQuick.Controls 1.0 +import QtQuick.Controls.Styles.Nemo 1.0 + +ProgressBar { + style: ProgressBarStyle{} +} diff --git a/src/controls/qml/qmldir b/src/controls/qml/qmldir index 9c23d02..1e5997d 100644 --- a/src/controls/qml/qmldir +++ b/src/controls/qml/qmldir @@ -29,6 +29,7 @@ DatePicker 1.0 DatePicker.qml TimePicker 1.0 TimePicker.qml ScrollDecorator 1.0 ScrollDecorator.qml TextField 1.0 TextField.qml +ProgressBar 1.0 ProgressBar.qml # MIRRORED CONTROLS: # These are the controls that we take directly from official QQC. @@ -41,11 +42,9 @@ TextField 1.0 TextField.qml ComboBox 1.0 ../ComboBox.qml GroupBox 1.0 ../GroupBox.qml - MenuBar 1.0 ../MenuBar.qml Menu 1.0 ../Menu.qml StackView 1.0 ../StackView.qml -ProgressBar 1.0 ../ProgressBar.qml RadioButton 1.0 ../RadioButton.qml ScrollView 1.0 ../ScrollView.qml SpinBox 1.0 ../SpinBox.qml diff --git a/src/styles/qml/GrooveStyle.qml b/src/styles/qml/GrooveStyle.qml deleted file mode 100644 index 41d1087..0000000 --- a/src/styles/qml/GrooveStyle.qml +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2013 Simonas Leleiva - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -import QtQuick 2.6 -import QtQuick.Controls.Nemo 1.0 - -Component { - Rectangle { - implicitHeight: Theme.itemHeightSmall/2 - implicitWidth: Theme.itemWidthLarge + Theme.itemWidthSmall - color: Theme.fillDarkColor - Rectangle { - antialiasing: true - radius: 1 - color: Theme.accentColor - height: parent.height - width: parent.width * control.value / control.maximumValue - } - } -} - diff --git a/src/styles/qml/ProgressBarStyle.qml b/src/styles/qml/ProgressBarStyle.qml index 526a8e5..d856098 100644 --- a/src/styles/qml/ProgressBarStyle.qml +++ b/src/styles/qml/ProgressBarStyle.qml @@ -1,5 +1,6 @@ /* * Copyright (C) 2013 Andrea Bernabei + * Copyright (C) 2018 Chupligin Sergey * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -18,12 +19,47 @@ */ import QtQuick 2.6 +import QtQuick.Controls.Nemo 1.0 import QtQuick.Controls.Styles 1.0 ProgressBarStyle { - GrooveStyle { - id: grooveStyle - } + panel: Rectangle { + implicitHeight: Theme.itemHeightSmall/2 + implicitWidth: Theme.itemWidthLarge + Theme.itemWidthSmall + color: Theme.fillDarkColor + + Rectangle { + antialiasing: true + radius: 1 + visible: !control.indeterminate + color: control.indeterminate ? "transparent" : Theme.accentColor + height: parent.height + width: parent.width * control.value / control.maximumValue + } - panel: grooveStyle; + Item { + anchors.fill: parent + anchors.margins: 1 + visible: control.indeterminate + clip: true + + Row { + Repeater { + Rectangle { + color: index % 2 ? Theme.fillDarkColor : Theme.accentColor + width: Theme.itemHeightExtraSmall/3 + height: control.height*2 + rotation: 40 + y: -control.height/2 + } + model: control.width/Theme.itemHeightExtraSmall*3+4 + } + XAnimator on x { + from: -(Theme.itemHeightExtraSmall/3*2) ; to: 0 + loops: Animation.Infinite + running: control.indeterminate + } + } + } + } } diff --git a/src/styles/styles.pro b/src/styles/styles.pro index f4cf01e..66bfc0c 100644 --- a/src/styles/styles.pro +++ b/src/styles/styles.pro @@ -12,7 +12,6 @@ QML_FILES = \ qml/CheckBoxStyle.qml \ qml/ComboBoxStyle.qml \ qml/FocusFrameStyle.qml \ - qml/GrooveStyle.qml \ qml/GroupBoxStyle.qml \ qml/MenuBarStyle.qml \ qml/MenuStyle.qml \