Add HProgressBar component
This commit is contained in:
parent
21b44bcf66
commit
18120f5216
23
src/qml/Base/HProgressBar.qml
Normal file
23
src/qml/Base/HProgressBar.qml
Normal 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue
Block a user