forked from liuleidong/BeautySlash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameProgressBar.qml
70 lines (68 loc) · 1.71 KB
/
GameProgressBar.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import QtQuick 2.0
import QtQuick.Controls 2.0
Item {
property alias value: progressBar.value
property double rate:height/35
ProgressBar{
id: progressBar
width: parent.width
height: parent.height
from: 0
to: 1
visible:false
contentItem: Item{
}
}
//自定义进度条-背景
Rectangle{
id: bar_progress_back
color: "transparent"
x:5*rate
y:5*rate
radius: 10*rate
width: parent.width - x*2
height: 20*rate
Image {
id: bar_progress_back_img
anchors.fill:parent
source: "pics/progress/progress_back.png"
}
//进度
Rectangle {
id:contentItem_rec
x:bar_progress_back.x
y:0
radius: bar_progress_back.radius
width: bar_progress_back.width*progressBar.value
height: bar_progress_back.height
//radius: bar_progress_back.radius
color: "#17a81a"
}
}
//边界
Rectangle {
id: bar_border
color: "transparent"
border.color: "#c8b154"
border.width:5*rate
x:bar_progress_back.x
y:bar_progress_back.y
radius: bar_progress_back.radius
width: bar_progress_back.width
height: bar_progress_back.height
}
//标志
Rectangle {
id: bar_flag
x:bar_progress_back.x + bar_progress_back.width*8/10
y:bar_progress_back.y
width: 10*rate
height: bar_progress_back.height+10*rate
color: "transparent"
Image {
id: bar_progress_flag
anchors.fill:parent
source: "pics/progress/progress_flag.png"
}
}
}