-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathBoardCircle.qml
62 lines (54 loc) · 1.07 KB
/
BoardCircle.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
import QtQuick 2.5
import Material 0.1
Item {
id: root
// property double length: Units.dp(100)
property double length: parent.parent.gridLength
property string color: "red"
property int posX: 0
property int posY: 0
x: posX * length
y: posY * length
states: [
State {
name: "hidden"
PropertyChanges { target: view; scale: 0.0 }
PropertyChanges { target: view; visible: false }
},
State {
name: "shown"
PropertyChanges { target: view; scale: 1.0 }
PropertyChanges { target: view; visible: true }
}
]
state: "hidden"
width: length
height: length
View {
id: view
anchors.centerIn: parent
elevation: 2
width: (length / 4 * 3) * scale
height: width
radius: width / 2
antialiasing: true
property double scale: 0.0
Behavior on scale {
SpringAnimation {
spring: 1.2
damping: 0.12
epsilon: 0.01
}
}
Rectangle {
id: rect
anchors.fill: parent
anchors.centerIn: parent
width: parent.width + 20
height: width
radius: width / 2
antialiasing: true
color: Palette.colors[root.color]["500"]
}
}
}