Add HProgressBar component

This commit is contained in:
miruka 2019-08-28 14:28:20 -04:00
parent 21b44bcf66
commit 18120f5216
3 changed files with 29 additions and 3 deletions

View File

@ -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
}
}
}

View File

@ -1,8 +1,6 @@
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
import "../../Base" import "../../Base"
import "../../utils.js" as Utils
HColumnLayout { HColumnLayout {
readonly property int progress: accountInfo.importing_key readonly property int progress: accountInfo.importing_key
@ -43,7 +41,7 @@ HColumnLayout {
} }
} }
ProgressBar { HProgressBar {
id: progressBar id: progressBar
from: 0 from: 0
value: progress value: progress

View File

@ -149,6 +149,11 @@ controls:
color border: "black" color border: "black"
int borderWidth: 2 int borderWidth: 2
progressBar:
int height: Math.max(2, spacing / 2)
color background: colors.inputBackground
color foreground: colors.accentBackground
avatar: avatar:
int size: baseElementsHeight int size: baseElementsHeight
int radius: theme.radius int radius: theme.radius