-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgressBar.qml
43 lines (34 loc) · 1.11 KB
/
ProgressBar.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Rectangle {
id: progressBarItem;
property bool active: true;
property real progress: 0; // 0..1
property Color barColor;
property int animationDuration: 1000;
property string ttextUnderBar: "";
width: 55;
color: active ? "#f0f0f0" : "#000000";//colorTheme.focusColor : "#000000";
barColor: colorTheme.activeFocusTop;
//clip: true;
radius: width / 50;
Rectangle {
id: filledArea;
//anchors.top: parent.top;
anchors.left: parent.left;
anchors.bottom: parent.bottom;
anchors.right: parent.right;
height: parent.height * progressBarItem.progress;
color: progressBarItem.active ? progressBarItem.barColor : colorTheme.borderColor;
radius: progressBarItem.radius;
Behavior on opacity { animation: Animation { duration: 500; } }
Behavior on height { id: filledAreaWidthAnim; animation: Animation { duration: progressBarItem.animationDuration; } }
}
reset: { filledAreaWidthAnim.complete(); }
SecondaryText {
id: textUnderBar;
anchors.top: parent.bottom;
anchors.horizontalCenter: parent.horizontalCenter;
anchors.topMargin: 5;
text: progressBarItem.ttextUnderBar;
color: "#000";
}
}