-
Notifications
You must be signed in to change notification settings - Fork 11
/
BoardGrid.qml
74 lines (64 loc) · 1.29 KB
/
BoardGrid.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
71
72
73
import QtQuick 2.5
import Material 0.1
Item {
id: root
// property double length: Units.dp(100)
property double length: gridLength
property string color: "grey"
property int posX: 0
property int posY: 0
x: posX * length
y: posY * length
function ripple() {
var x = ink.width / 2;
var y = ink.height / 2;
ink.createTapCircle(x, y);
ink.currentCircle.removeCircle();
}
states: [
State {
name: "hidden"
PropertyChanges { target: view; scale: 0.0 }
},
State {
name: "shown"
PropertyChanges { target: view; scale: 1.0 }
}
]
state: "hidden"
View {
id: view
elevation: 1
x: length * (1.0 - scale) / 2
y: x
width: length * scale
height: width
radius: length / 20
property double scale: 1.0
Behavior on scale {
SpringAnimation {
spring: 2.0
damping: 0.25
epsilon: 0.01
}
}
Ink {
id: ink
anchors.fill: parent
Rectangle {
id: rect
anchors.fill: parent
radius: length / 20
opacity: 0.3
color: Palette.colors[root.color]["500"]
// border.width: modelData === "white" ? Units.dp(2) : 0
// border.color: Theme.alpha("#000", 0.26)
border.width: length / 50
border.color: Palette.colors[root.color]["700"]
Behavior on color {
ColorAnimation { duration: 100 }
}
}
}
}
}