From 18120f5216c7455ee120c92ad41a2946cd9faaab Mon Sep 17 00:00:00 2001 From: miruka Date: Wed, 28 Aug 2019 14:28:20 -0400 Subject: [PATCH] Add HProgressBar component --- src/qml/Base/HProgressBar.qml | 23 +++++++++++++++++++++ src/qml/Pages/EditAccount/ImportingKeys.qml | 4 +--- src/themes/Default.qpl | 5 +++++ 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 src/qml/Base/HProgressBar.qml diff --git a/src/qml/Base/HProgressBar.qml b/src/qml/Base/HProgressBar.qml new file mode 100644 index 00000000..4606bfc6 --- /dev/null +++ b/src/qml/Base/HProgressBar.qml @@ -0,0 +1,23 @@ +import QtQuick 2.12 +import QtQuick.Controls 2.12 + +ProgressBar { + id: bar + + background: Rectangle { + implicitWidth: 200 + implicitHeight: theme.controls.progressBar.height + color: theme.controls.progressBar.background + } + + contentItem: Item { + implicitWidth: 200 + implicitHeight: theme.controls.progressBar.height + + Rectangle { + width: bar.visualPosition * parent.width + height: parent.height + color: theme.controls.progressBar.foreground + } + } +} diff --git a/src/qml/Pages/EditAccount/ImportingKeys.qml b/src/qml/Pages/EditAccount/ImportingKeys.qml index b933395f..70b1e631 100644 --- a/src/qml/Pages/EditAccount/ImportingKeys.qml +++ b/src/qml/Pages/EditAccount/ImportingKeys.qml @@ -1,8 +1,6 @@ import QtQuick 2.12 -import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 import "../../Base" -import "../../utils.js" as Utils HColumnLayout { readonly property int progress: accountInfo.importing_key @@ -43,7 +41,7 @@ HColumnLayout { } } - ProgressBar { + HProgressBar { id: progressBar from: 0 value: progress diff --git a/src/themes/Default.qpl b/src/themes/Default.qpl index 0e2e100d..4034c018 100644 --- a/src/themes/Default.qpl +++ b/src/themes/Default.qpl @@ -149,6 +149,11 @@ controls: color border: "black" int borderWidth: 2 + progressBar: + int height: Math.max(2, spacing / 2) + color background: colors.inputBackground + color foreground: colors.accentBackground + avatar: int size: baseElementsHeight int radius: theme.radius