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 {
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
}
}
}
}
}
......@@ -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 \
......
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
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
......
/*
* 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) 2018 Chupligin Sergey <neochapay@gmail.com>
*
* 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
}
}
}
}
}
......@@ -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 \
......
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