-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathalert.qml
182 lines (151 loc) · 6.32 KB
/
alert.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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
import QtQuick 2.4
import QtQuick.Controls 1.3
import QtQuick.Controls.Styles 1.3
import QtGraphicalEffects 1.0
Rectangle {
signal doneClicked(int taskId)
signal cancelClicked(int taskId)
anchors.centerIn: parent
width: parent.width
height: parent.height
id: mainRectangle;
objectName: "mainRectangle";
Rectangle {
property var priority : context.Task.priority
id: priorityRect
width: parent.width*0.15
height: parent.height
//color: mouseArea.containsMouse ? "#682244" : "#D5BC7C"
color: {
if(priority == "A"){
return "#c0392b"
}
if(priority == "B"){
return "#f1c40f"
}
if(priority == "C"){
return "#27ae60"
}
else {
return "#27ae60"
}
}
Text { text: context.Task.priority
font.pointSize: 30
anchors.centerIn: parent }
}
Rectangle {
width: parent.width-priorityRect.width
height: parent.height*0.5
color: "#2980b9"
anchors.top: parent.top
anchors.right: parent.right
Text { text: context.Task.message
font.pixelSize: Math.round(parent.height / 2.5)
width:parent.width - parent.width * 0.10
color: "#ecf0f1"
clip:true
elide: Text.ElideRight
anchors.centerIn: parent }
}
Rectangle {
width: parent.width-priorityRect.width
height: parent.height*0.5
color: "#5F7EAA"
anchors.bottom: parent.bottom
anchors.right: parent.right
Rectangle {
width: parent.width *0.5
height: parent.height
color: "#446CB3"
anchors.bottom: parent.bottom
anchors.left: parent.left
Rectangle {
width: parent.width / 2
height: parent.height
color: "#446CB3"
anchors.left: parent.left
Image {
id:clockImage
width: parent.height -6
height: parent.height -6
verticalAlignment: parent.AlignVCenter
source: "icons/png/clock.png"
fillMode: Image.PreserveAspectFit
anchors.centerIn: parent
clip: true
}
}
Rectangle {
width: parent.width / 2
height: parent.height
color: "#446CB3"
anchors.right: parent.right
Text { text: context.Task.hour_minute
font.pointSize: 12
font.pixelSize: Math.round(parent.height / 2)
color: "#ecf0f1"
anchors.centerIn: parent }
}
}
Rectangle {
id: doneRectangle
width: parent.width *0.5
height: parent.height
color: "#446CB3"
anchors.bottom: parent.bottom
anchors.right: parent.right
Button {
property var taskId : context.Task.id
id: checkDoneButton
width: parent.width *0.5 - 1
height: parent.height
anchors.right: parent.right
style: ButtonStyle {
background: Rectangle {
color: control.hovered? "#67809F" : "#27ae60"
Behavior on color {
ColorAnimation{
duration: 400
easing.type: Easing.InOutQuad
}
}
Text { text: "Set done"
font.pixelSize: Math.round(parent.height / 2.5)
color: "#ecf0f1"
anchors.centerIn: parent }
}
}
onClicked: {
mainRectangle.doneClicked(taskId)
}
}
Button {
property var taskId : context.Task.id
id: cancelButton
width: parent.width *0.5 - 1
height: parent.height
anchors.rightMargin:2
anchors.left: parent.left
style: ButtonStyle {
background: Rectangle {
color: control.hovered? "#67809F" : "#8e44ad"
Behavior on color {
ColorAnimation{
duration: 400
easing.type: Easing.InOutQuad
}
}
Text { text: "Delay 30 min"
font.pixelSize: Math.round(parent.height / 2.5)
color: "#ecf0f1"
anchors.centerIn: parent }
}
}
onClicked: {
mainRectangle.cancelClicked(taskId)
}
}
}
}
}