Commit 865503d5 authored by Aleksi Suomalainen's avatar Aleksi Suomalainen Committed by GitHub

Merge pull request #66 from neochapay/progressbar_up

[ProgressBar] Add indication of indeterminate progressbar
parents edec39d7 2476ff42
...@@ -82,28 +82,9 @@ Page { ...@@ -82,28 +82,9 @@ Page {
ProgressBar { ProgressBar {
anchors.margins: 20 anchors.margins: 20
style: touchStyle indeterminate: true
value: 1 value: 0.85
width: 400 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
}
}
}
}
} }
...@@ -15,6 +15,7 @@ QML_FILES += \ ...@@ -15,6 +15,7 @@ QML_FILES += \
qml/Checkbox.qml\ qml/Checkbox.qml\
qml/ButtonRow.qml \ qml/ButtonRow.qml \
qml/Header.qml \ qml/Header.qml \
qml/ProgressBar.qml \
qml/HeaderToolsLayout.qml \ qml/HeaderToolsLayout.qml \
qml/Slider.qml\ qml/Slider.qml\
qml/ListView.qml \ qml/ListView.qml \
......
import QtQuick 2.6
import QtQuick.Controls 1.0
import QtQuick.Controls.Styles.Nemo 1.0
ProgressBar {
style: ProgressBarStyle{}
}
...@@ -29,6 +29,7 @@ DatePicker 1.0 DatePicker.qml ...@@ -29,6 +29,7 @@ DatePicker 1.0 DatePicker.qml
TimePicker 1.0 TimePicker.qml TimePicker 1.0 TimePicker.qml
ScrollDecorator 1.0 ScrollDecorator.qml ScrollDecorator 1.0 ScrollDecorator.qml
TextField 1.0 TextField.qml TextField 1.0 TextField.qml
ProgressBar 1.0 ProgressBar.qml
# MIRRORED CONTROLS: # MIRRORED CONTROLS:
# These are the controls that we take directly from official QQC. # These are the controls that we take directly from official QQC.
...@@ -41,11 +42,9 @@ TextField 1.0 TextField.qml ...@@ -41,11 +42,9 @@ TextField 1.0 TextField.qml
ComboBox 1.0 ../ComboBox.qml ComboBox 1.0 ../ComboBox.qml
GroupBox 1.0 ../GroupBox.qml GroupBox 1.0 ../GroupBox.qml
MenuBar 1.0 ../MenuBar.qml MenuBar 1.0 ../MenuBar.qml
Menu 1.0 ../Menu.qml Menu 1.0 ../Menu.qml
StackView 1.0 ../StackView.qml StackView 1.0 ../StackView.qml
ProgressBar 1.0 ../ProgressBar.qml
RadioButton 1.0 ../RadioButton.qml RadioButton 1.0 ../RadioButton.qml
ScrollView 1.0 ../ScrollView.qml ScrollView 1.0 ../ScrollView.qml
SpinBox 1.0 ../SpinBox.qml SpinBox 1.0 ../SpinBox.qml
......
/*
* Copyright (C) 2013 Simonas Leleiva <simonas.leleiva@gmail.com>
*
* 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
}
}
}
/* /*
* Copyright (C) 2013 Andrea Bernabei <and.bernabei@gmail.com> * Copyright (C) 2013 Andrea Bernabei <and.bernabei@gmail.com>
* Copyright (C) 2018 Chupligin Sergey <neochapay@gmail.com>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
...@@ -18,12 +19,47 @@ ...@@ -18,12 +19,47 @@
*/ */
import QtQuick 2.6 import QtQuick 2.6
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles 1.0 import QtQuick.Controls.Styles 1.0
ProgressBarStyle { ProgressBarStyle {
GrooveStyle { panel: Rectangle {
id: grooveStyle 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
}
}
}
}
} }
...@@ -12,7 +12,6 @@ QML_FILES = \ ...@@ -12,7 +12,6 @@ QML_FILES = \
qml/CheckBoxStyle.qml \ qml/CheckBoxStyle.qml \
qml/ComboBoxStyle.qml \ qml/ComboBoxStyle.qml \
qml/FocusFrameStyle.qml \ qml/FocusFrameStyle.qml \
qml/GrooveStyle.qml \
qml/GroupBoxStyle.qml \ qml/GroupBoxStyle.qml \
qml/MenuBarStyle.qml \ qml/MenuBarStyle.qml \
qml/MenuStyle.qml \ qml/MenuStyle.qml \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment