-
Notifications
You must be signed in to change notification settings - Fork 15
/
WorkViewText.qml
230 lines (187 loc) · 5.77 KB
/
WorkViewText.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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
import QtQuick 1.1
Rectangle {
id: main
property alias header: header
property alias day_stats: day_stats
property alias work_u: work_units_number
property alias work_d: work_duration
property alias break_d: break_duration
property alias pause_d: pause_duration
property alias work_d_p: work_d_p
property alias break_d_p: break_d_p
property alias pause_d_p: pause_d_p
color: styl.panel_back_color
width: 100
height: day_stats.visible ? 190 : 80
Behavior on height { NumberAnimation { duration: 50}}
Text {
id: header
property string hidden_date: "" // Store date from Calendar
color: styl.text_color_secondary
anchors {
top: parent.top
topMargin: 10
horizontalCenter: parent.horizontalCenter
}
text: qsTr("")
font {family: "Ubuntu Light"; pixelSize: 24}
}
Text {
id: no_activities
visible: !day_stats.visible
color: styl.text_color_primary
anchors {
top: header.bottom
topMargin: 15
horizontalCenter: parent.horizontalCenter
}
text: qsTr("No Activities")
font {family: "Ubuntu Light"; pixelSize: 18}
}
Rectangle {
id: day_stats
color: "transparent"
width: parent.width
height: parent.height - header.height - 15
anchors {
top: header.bottom
topMargin: 15
}
Text {
id: work_units_number_d
color: styl.text_color_secondary
x: parent.width/2 - width - 4
anchors {
top: parent.top
}
text: qsTr("Work units:")
font {family: "Ubuntu"; pixelSize: 14}
}
Text {
id: work_units_number
color: styl.text_color_primary
x: parent.width/2 + 4
anchors {
baseline: work_units_number_d.baseline
}
text: qsTr("")
font {family: "Ubuntu"; pixelSize: 18}
}
Text {
id: work_duration_d
color: "#C0292F"
x: parent.width/2 - width - 4
anchors {
top: work_units_number_d.bottom
topMargin: 10
}
text: qsTr("Work duration:")
font {family: "Ubuntu"; pixelSize: 14}
}
Text {
id: work_duration
color: styl.text_color_primary
x: parent.width/2 + 4
anchors {
baseline: work_duration_d.baseline
}
text: qsTr("")
font {family: "Ubuntu"; pixelSize: 18}
}
Text {
id: break_duration_d
color: "#95B7DB"
x: parent.width/2 - width - 4
anchors {
top: work_duration_d.bottom
topMargin: 10
}
text: qsTr("Break duration:")
font {family: "Ubuntu"; pixelSize: 14}
}
Text {
id: break_duration
color: styl.text_color_primary
x: parent.width/2 + 4
anchors {
baseline: break_duration_d.baseline
}
text: qsTr("")
font {family: "Ubuntu"; pixelSize: 18}
}
Text {
id: pause_duration_d
color: styl.text_color_secondary
x: parent.width/2 - width - 4
anchors {
top: break_duration_d.bottom
topMargin: 10
}
text: qsTr("Pause duration:")
font {family: "Ubuntu"; pixelSize: 14}
}
Text {
id: pause_duration
color: styl.text_color_primary
x: parent.width/2 + 4
anchors {
baseline: pause_duration_d.baseline
}
text: qsTr("")
font {family: "Ubuntu"; pixelSize: 18}
}
Rectangle {
id: hundred_p_day_stat
color: pause_duration_d.color
x: 6
width: parent.width - 12
height: 10
anchors {
top: pause_duration.bottom
topMargin: 20
}
Rectangle {
id: work_d_p
property double work_d_p_mnoznik: 0
color: work_duration_d.color
width: work_d_p_mnoznik * parent.width
height: parent.height
anchors {
top: parent.top
left: parent.left
}
Behavior on width {
NumberAnimation { easing.type: Easing.OutQuint; duration: 500 }
}
}
Rectangle {
id: break_d_p
property double break_d_p_mnoznik: 0
color: break_duration_d.color
width: break_d_p_mnoznik * parent.width
height: parent.height
anchors {
top: parent.top
left: work_d_p.right
}
Behavior on width {
NumberAnimation { easing.type: Easing.OutQuint; duration: 500 }
}
}
Rectangle {
id: pause_d_p
property double pause_d_p_mnoznik: 0
color: pause_duration_d.color
width: pause_d_p_mnoznik * parent.width
height: parent.height
anchors {
top: parent.top
left: break_d_p.right
}
Behavior on width {
NumberAnimation { easing.type: Easing.OutQuint; duration: 500 }
}
}
}
}
}