@@ -14,6 +14,7 @@ Button {
14
14
property alias borderColor: backgroundRectangle .border .color
15
15
property bool dropdown: false
16
16
property real progressValue: 0.0
17
+ property bool showProgress: false
17
18
18
19
signal dropdownClicked
19
20
@@ -49,8 +50,8 @@ Button {
49
50
}
50
51
51
52
Loader {
52
- active: progressValue != 0.0 && progressValue != 1.0
53
- sourceComponent: progressComponent
53
+ active: showProgress
54
+ sourceComponent: progressValue == 0.0 ? indeterminateProgressComponent : progressComponent
54
55
}
55
56
56
57
Component {
@@ -63,10 +64,11 @@ Button {
63
64
clip: true
64
65
65
66
Rectangle {
66
- width: Math .min (10 , parent .width / 2 )
67
+ width: Math .min (20 , parent .width / 2 )
67
68
height: parent .height
68
69
anchors .right : parent .right
69
70
color: parent .color
71
+ radius: progressValue > 0.98 ? parent .radius : 0
70
72
}
71
73
72
74
Behavior on width {
@@ -76,6 +78,38 @@ Button {
76
78
}
77
79
}
78
80
}
81
+ Component {
82
+ id: indeterminateProgressComponent
83
+ Item {
84
+ width: backgroundRectangle .width
85
+ height: backgroundRectangle .height
86
+ clip: true
87
+
88
+ Rectangle {
89
+ id: bar
90
+ width: parent .width * 0.3
91
+ height: parent .height
92
+ radius: 2
93
+ color: Theme .mainColor
94
+ opacity: 0.9
95
+ SequentialAnimation on x {
96
+ loops: Animation .Infinite
97
+ NumberAnimation {
98
+ from: - bar .width
99
+ to: parent .width
100
+ duration: 2000
101
+ easing .type : Easing .Linear
102
+ }
103
+ NumberAnimation {
104
+ from: parent .width
105
+ to: - bar .width
106
+ duration: 2000
107
+ easing .type : Easing .Linear
108
+ }
109
+ }
110
+ }
111
+ }
112
+ }
79
113
}
80
114
81
115
contentItem: IconLabel {
0 commit comments