From 15e66a7a18505db75f1449465f05a3bc056fb64c Mon Sep 17 00:00:00 2001 From: Tamara Hogenhout Date: Tue, 16 Jun 2015 14:42:37 +0200 Subject: [PATCH] adds styling for both the regular as the indeterminate progressbar Commits to #44 --- resources/themes/cura/styles.qml | 76 ++++++++++---------------------- 1 file changed, 23 insertions(+), 53 deletions(-) diff --git a/resources/themes/cura/styles.qml b/resources/themes/cura/styles.qml index 1f87538d30..243c12aedb 100644 --- a/resources/themes/cura/styles.qml +++ b/resources/themes/cura/styles.qml @@ -152,69 +152,39 @@ QtObject { } - property Component progressbar_regular: Component{ + property Component progressbar: Component{ ProgressBarStyle { - background: Rectangle { + background: UM.AngledCornerRectangle { + cornerSize: UM.Theme.sizes.progressbar_control.height implicitWidth: UM.Theme.sizes.progressbar.width implicitHeight: UM.Theme.sizes.progressbar.height - color: "transparent" - Item { - anchors.fill: parent - UM.AngledCornerRectangle { - cornerSize: UM.Theme.sizes.progressbar_control.height - color: UM.Theme.colors.progressbar_background - width: UM.Theme.sizes.progressbar.width - height: UM.Theme.sizes.progressbar.height - } - } + color: UM.Theme.colors.progressbar_background } progress: UM.AngledCornerRectangle { cornerSize: UM.Theme.sizes.progressbar_control.height - color: UM.Theme.colors.progressbar_control + color: control.indeterminate ? "transparent" : UM.Theme.colors.progressbar_control + + UM.AngledCornerRectangle { + cornerSize: UM.Theme.sizes.progressbar_control.height + color: UM.Theme.colors.progressbar_control + width: UM.Theme.sizes.progressbar_control.width + height: UM.Theme.sizes.progressbar_control.height + visible: control.indeterminate + + SequentialAnimation on x { + id: xAnim + property int animEndPoint: UM.Theme.sizes.progressbar.width - UM.Theme.sizes.progressbar_control.width + running: control.indeterminate + loops: Animation.Infinite + NumberAnimation { from: 0; to: xAnim.animEndPoint; duration: 2000;} + NumberAnimation { from: xAnim.animEndPoint; to: 0; duration: 2000;} + } + } } } } - property Component progressbar_indeterminate: Component{ - ProgressBarStyle { - background: UM.AngledCornerRectangle { - anchors.fill: parent - anchors.left: parent.left - implicitWidth: UM.Theme.sizes.progressbar.width - implicitHeight: UM.Theme.sizes.progressbar.height - color: "transparent" - } - progress: UM.AngledCornerRectangle { - anchors.left: parent.left - anchors.fill: parent - cornerSize: UM.Theme.sizes.progressbar_control.height - color: UM.Theme.colors.progressbar_background - Item { - anchors.fill: parent - visible: control.indeterminate - Row { - Repeater { - UM.AngledCornerRectangle { - cornerSize: UM.Theme.sizes.progressbar_control.height - color: UM.Theme.colors.progressbar_control - width: UM.Theme.sizes.progressbar_control.width - height: UM.Theme.sizes.progressbar_control.height - } - model: 1 - } - SequentialAnimation on x { - id: xAnim - property int animEndPoint: UM.Theme.sizes.progressbar.width - UM.Theme.sizes.progressbar_control.width - running: control.indeterminate - loops: Animation.Infinite - NumberAnimation { from: 0; to: xAnim.animEndPoint; duration: 2000;} - NumberAnimation { from: xAnim.animEndPoint; to: 0; duration: 2000;} - } - } - } - } - } - } + property Component sidebar_category: Component { ButtonStyle {