-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathActionDelegate.qml
155 lines (144 loc) · 5.36 KB
/
ActionDelegate.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
import QtQuick 2.12
import QtQuick.Controls 1.4
Item {
id: actionDelegate
width: map.width/4
height: map.width/20
Rectangle {
id: dragRect
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
width: parent.width; height: parent.height
color: done ? "white" : "transparent"
opacity: done ? .7 : 1
//MouseArea{
// id: dragArea
// anchors.fill: parent
// property bool held: false
// drag.axis: Drag.YAxis
// onPressed: {
// parameterArea.visible = !parameterArea.visible
// }
//}
Row {
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
width: parent.width
height: parent.height*.8
spacing: width/20
Row {
id: imageRow
width: parent.width/3; height: parent.height
spacing: width/40
Item{
width: parent.width/3.2
height: parent.height
Image{
anchors.fill:parent
source: "/res/"+img1.split("_")[0]+".png"
fillMode: Image.PreserveAspectFit
}
Text{
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: img1.split("_")[1]
color: "white"
font.bold: true
font.pixelSize: parent.width/2
}
}
Item{
width: parent.width/3.2
height: parent.height
Image{
anchors.fill:parent
source: "/res/"+img2+".png"
fillMode: Image.PreserveAspectFit
}
Component.onCompleted: console.log(img2)
}
Item{
width: parent.width/3.2
height: parent.height
Image{
anchors.fill:parent
source: "/res/"+img3.split("_")[0]+".png"
fillMode: Image.PreserveAspectFit
}
Text{
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: img3.split("_")[1]
color: "white"
font.bold: true
font.pixelSize: parent.width/2
}
}
}
Text {
text: name+' ' + targetDisplay
width: parent.width*2/3.2
height: parent.height
wrapMode: Text.WordWrap
font.italic: true
verticalAlignment: Text.AlignVCenter
font.pixelSize: parent.height/2
}
}
Rectangle{
id: separator
width:parent.width
anchors.bottom: parent.bottom
height: 2
color: "grey"
}
}
Item {
id: parameterArea
width: 600
height: 200
anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.right
visible: false
Canvas {
id: parameterBubble
antialiasing: true
z:1
anchors.fill: parent
onPaint: {
var ctx = parameterBubble.getContext('2d');
var ref = parent
var triangleSize = width/40
var radius = width/10
ctx.reset();
var recHeight = .9 * height
var recWidth = .9 * width
var xoffset = (width-recWidth)/2
var yoffset = (height-recHeight)/2
ctx.lineJoin = "round"
ctx.lineCap="round";
ctx.lineWidth = 10
ctx.strokeStyle = "#ffc27a";
ctx.fillStyle = "#B0f8f8ff";
ctx.beginPath();
ctx.moveTo(xoffset, height/2);
ctx.lineTo(xoffset+triangleSize, height/2-triangleSize);
ctx.lineTo(xoffset+triangleSize, radius+yoffset);
ctx.arc(xoffset+triangleSize+radius, radius+yoffset,radius, Math.PI,3*Math.PI/2)
ctx.lineTo(xoffset+recWidth-radius, yoffset);
ctx.arc(xoffset+recWidth-radius, radius+yoffset,radius, -Math.PI/2,0)
ctx.lineTo(xoffset+recWidth, recHeight - radius+yoffset);
ctx.arc(xoffset+recWidth-radius, recHeight-radius+yoffset,radius, 0, Math.PI/2)
ctx.lineTo(xoffset+triangleSize+radius, recHeight+yoffset);
ctx.arc(xoffset+triangleSize+radius, recHeight-radius+yoffset,radius, Math.PI/2, Math.PI)
ctx.lineTo(xoffset+triangleSize, height/2+triangleSize);
ctx.lineTo(xoffset, height/2);
ctx.stroke();
ctx.fill()
}
}
Component.onCompleted: parameterBubble.requestPaint()
}
}