-
Notifications
You must be signed in to change notification settings - Fork 15
/
EditPomodoroTime.qml
227 lines (191 loc) · 6.26 KB
/
EditPomodoroTime.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
import QtQuick 1.1
Rectangle {
id: editpomodorotime
property alias setting_name: setting_name
property alias okmouse: okbutton.button_ma
property alias m1: m1
property alias m2: m2
property alias s1: s1
property alias s2: s2
Behavior on scale {NumberAnimation{}}
color: styl.dialog_back_color
width: 400
height: 250
radius: 4
// Name of setting
Text {
id: setting_name
color: styl.text_color_secondary
anchors {
top: parent.top
topMargin: 18
horizontalCenter: parent.horizontalCenter
}
text: ""
font {pixelSize: 18; family: "Ubuntu Light"}
}
DividerSmallHor {
id: divider1
width: parent.width - 24
anchors {
top: setting_name.bottom
topMargin: 12
horizontalCenter: parent.horizontalCenter
}
}
Item {
id: time
width: m1.width + m2.width + s1.width + s2.width + 12
height: m1.height
anchors {
top: setting_name.bottom
topMargin: 36
horizontalCenter: parent.horizontalCenter
}
// minutes dziesiątki
DigitSelector10 {
id: m1
anchors {
left: parent.left
top: parent.top
}
Keys.onRightPressed: m2.focus = true
Keys.onDigit0Pressed: m2.focus = true
Keys.onDigit1Pressed: m2.focus = true
Keys.onDigit2Pressed: m2.focus = true
Keys.onDigit3Pressed: m2.focus = true
Keys.onDigit4Pressed: m2.focus = true
Keys.onDigit5Pressed: m2.focus = true
Keys.onDigit6Pressed: m2.focus = true
Keys.onDigit7Pressed: m2.focus = true
Keys.onDigit8Pressed: m2.focus = true
Keys.onDigit9Pressed: m2.focus = true
Keys.onEnterPressed: okmouse.clicked(true)
Keys.onReturnPressed: okmouse.clicked(true)
KeyNavigation.backtab: okbutton
KeyNavigation.tab: cancelbutton
}
// minutes jednostki
DigitSelector10 {
id: m2
anchors {
left: m1.right
leftMargin: 3
top: parent.top
}
Keys.onLeftPressed: m1.focus = true
Keys.onRightPressed: s1.focus = true
Keys.onDigit0Pressed: s1.focus = true
Keys.onDigit1Pressed: s1.focus = true
Keys.onDigit2Pressed: s1.focus = true
Keys.onDigit3Pressed: s1.focus = true
Keys.onDigit4Pressed: s1.focus = true
Keys.onDigit5Pressed: s1.focus = true
Keys.onDigit6Pressed: s1.focus = true
Keys.onDigit7Pressed: s1.focus = true
Keys.onDigit8Pressed: s1.focus = true
Keys.onDigit9Pressed: s1.focus = true
Keys.onEnterPressed: okmouse.clicked(true)
Keys.onReturnPressed: okmouse.clicked(true)
KeyNavigation.backtab: okbutton
KeyNavigation.tab: cancelbutton
}
// separator
Text {
id: separator2
color: styl.text_color_primary
anchors {
left: m2.right
leftMargin: 1
verticalCenter: m2.verticalCenter
}
text: ":"
font {pixelSize: 20; family: "Ubuntu"}
}
// seconds dziesiątki
DigitSelector6 {
id: s1
anchors {
left: m2.right
leftMargin: 6
top: parent.top
}
Keys.onLeftPressed: m2.focus = true
Keys.onRightPressed: s2.focus = true
Keys.onDigit0Pressed: s2.focus = true
Keys.onDigit1Pressed: s2.focus = true
Keys.onDigit2Pressed: s2.focus = true
Keys.onDigit3Pressed: s2.focus = true
Keys.onDigit4Pressed: s2.focus = true
Keys.onDigit5Pressed: s2.focus = true
Keys.onEnterPressed: okmouse.clicked(true)
Keys.onReturnPressed: okmouse.clicked(true)
KeyNavigation.backtab: okbutton
KeyNavigation.tab: cancelbutton
}
DigitSelector10 {
id: s2
anchors {
left: s1.right
leftMargin: 3
top: parent.top
}
Keys.onLeftPressed: s1.focus = true
Keys.onRightPressed: okbutton.focus = true
Keys.onDigit0Pressed: okbutton.focus = true
Keys.onDigit1Pressed: okbutton.focus = true
Keys.onDigit2Pressed: okbutton.focus = true
Keys.onDigit3Pressed: okbutton.focus = true
Keys.onDigit4Pressed: okbutton.focus = true
Keys.onDigit5Pressed: okbutton.focus = true
Keys.onDigit6Pressed: okbutton.focus = true
Keys.onDigit7Pressed: okbutton.focus = true
Keys.onDigit8Pressed: okbutton.focus = true
Keys.onDigit9Pressed: okbutton.focus = true
Keys.onEnterPressed: okmouse.clicked(true)
Keys.onReturnPressed: okmouse.clicked(true)
KeyNavigation.backtab: okbutton
KeyNavigation.tab: cancelbutton
}
}
// Info
Text {
id: digit_info
color: styl.text_color_secondary
anchors {
top: time.bottom
topMargin: 12
horizontalCenter: parent.horizontalCenter
}
text: qsTr("minutes : seconds")
font {pixelSize: 12; family: "Ubuntu"}
}
// Cancel button
Button {
id: cancelbutton
anchors {
left: parent.left
leftMargin: 12
bottom: parent.bottom
bottomMargin: 12
}
buttontext: qsTr("Cancel")
button_ma.onClicked: settingspomodoro.state = ""
KeyNavigation.backtab: m1
KeyNavigation.tab: okbutton
}
// Accept button
Button {
id: okbutton
buttoncolor: styl.button_back_color_ok
anchors {
right: parent.right
rightMargin: 12
bottom: parent.bottom
bottomMargin: 12
}
buttontext: qsTr("Save")
KeyNavigation.backtab: cancelbutton
KeyNavigation.tab: m1
}
}