-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbase.kv
260 lines (251 loc) · 7.14 KB
/
base.kv
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
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
#: kivy 2.0.0
#:import time datetime.time
#:import now datetime.datetime
<LogRow>:
ll_row: ll_row.__self__
rt_row: rt_row.__self__
orientation: 'horizontal'
padding:10,10
spacing: 20
Label:
size_hint_x: 0.2 + 0.1 * int(not root.use_rt)
text_size: self.size
halign: 'left'
valign: 'center'
color: 0, 0, 0
bold: True
font_size:(self.height ** 1.6 + self.width**1.2) ** 0.5
text:str(root.carno) if root.carno else ''
TimeLabel:
size_hint_x: 0.3 + 0.1 * int(not root.use_ll) + 0.3 * int(not root.use_rt)
font_size: (self.height ** 1.8 + self.width**1.2) ** 0.5
color: 0, 0, 0
update:False
tm:root.tm
Label:
bold:True
id:rt_row
size_hint_x: 0.4 if root.use_ll else 0.5
font_size: (self.height ** 1.5 + self.width**1.2) ** 0.5
color:0,0,0
text: root.rtime.strftime("%H:%M:%S") if root.is_rtm else ''
Label:
bold: True
id: ll_row
size_hint_x: 0.1
font_size:(self.height ** 1.8 + self.width**1.2) ** 0.5
color: 0,0,0
text: 'No' if not root.LL else 'Yes'
<RallyRow>:
ll_but:ll_but.__self__
rt_but:rt_but.__self__
rtm_label:rtm_label.__self__
tm_box: tm_box
car: car
carno: car.text
orientation: 'horizontal'
padding:10,10
spacing: 20
NumericInput:
text_validate_unfocus: not root.wrong_car
id: car
text:root.carno
size_hint_x: 0.2 + 0.05 * (int(root.use_ll) +int(root.use_rt))
font_size: self.height * 0.6
size: self.size
on_text_validate: root.on_enter()
BoxLayout:
id: tm_box
size_hint_x: 0.6 + 0.05 * (int(root.use_ll) +int(root.use_rt))
orientation: 'vertical'
TimeLabel:
size_hint_y: 0.7
color: 0, 0, 0
id: tm
update:False
tm:root.tm
Label:
id: rtm_label
size_hint_y: 0.3
bold:True
text_size: self.size
valign:'center'
halign:'right'
font_size: self.height * 0.9
color:0,0,0
text: root.rtm.strftime("%H:%M:%S") if root.is_rtm and root.rtm else ''
RoundedButton:
id:rt_but
color: 0,0,0
size_hint_x: 0.1
text: "RT"
on_release: root.on_rt(self)
RoundedButton:
id:ll_but
color: 0,0,0
size_hint_x: 0.1
text: "LL"
on_release: root.on_ll()
<RV>:
RecycleBoxLayout:
default_size: None, dp(56)
default_size_hint: 1, None
size_hint_y: None
height: self.minimum_height
orientation: 'vertical'
<RoundedButton>
background_color: 0,0,0,0
background_normal: ''
background_down:''
canvas.before:
Color:
rgb: 189/255, 228/255, 244/255
RoundedRectangle:
pos: self.pos
size: self.size
radius: [10,]
<NavigationBar>:
size_hint_y: 0.08
canvas.before:
Color:
rgb: 189/255, 228/255, 244/255
Rectangle:
pos: self.pos
size: self.size
orientation:'horizontal'
RoundedButton
size_hint_x: 0.3
color: 0,0,0
font_size: (self.height ** 1.9 + self.width**1.2) ** 0.5
text: 'Back'
bold: True
on_release: app.sm.current = "Home"
<LLPopup>:
title: 'Confirmation'
size_hint: (1,0.4)
BoxLayout:
orientation:'vertical'
Label:
size_hint_y:0.7
text: 'Do you want to give Lifeline?'
text_size: self.width, None
BoxLayout:
size_hint_y:0.3
orientation: 'horizontal'
Button:
text:'Yes'
on_release: root.on_ll()
Button:
text:'No'
on_release: root.row.LL = False;root.dismiss()
<Dialog>:
auto_dismiss: True
text: text
size_hint:None,None
background_color: (1,1,1,0.8)
overlay_color: (0,0,0,0)
pos_hint: {'center_x':0.5, 'center_y':0.1}
Label:
id: text
size: root.size
font_size: self.height * 0.28
text: ''
<TimeLabel>:
font_size: (self.height ** 1.9 + self.width**1.2) ** 0.5
bold: True
<RTimePopup>:
hour: hour
minute: minute
sec: second
auto_dismiss: False
title: 'Enter Restart Time'
size_hint: (1,0.4)
BoxLayout:
orientation: 'vertical'
size:self.parent.size
BoxLayout:
orientation:'horizontal'
size_hint_y:0.5
RTimeInput:
id: hour
pop:root.__self__
tm:root.tm
background_color: 0,0,0,0
foreground_color: 1,1,1,1
halign:'center'
font_size: self.height * 0.5
size_hint_x:0.3
text: f'{root.row.tm.hour:02}'
Label:
size_hint_x:0.05
text_size:self.size
text:':'
font_size: self.height * 0.5
valign:'top'
color:1,1,1
RTimeInput:
id: minute
pop:root.__self__
tm:root.tm
background_color: 0,0,0,0
foreground_color: 1,1,1,1
size_hint_x:0.3
font_size: self.height * 0.5
halign:'center'
text: f'{root.row.tm.minute:02}'
Label:
size_hint_x:0.05
text_size:self.size
font_size: self.height * 0.5
valign: 'top'
text:':'
color:1,1,1
RTimeInput:
id:second
pop:root.__self__
tm:root.tm
background_color: 0,0,0,0
foreground_color: 1,1,1,1
halign:'center'
font_size: self.height * 0.5
size_hint_x:0.3
text: f'{root.row.tm.second:02}'
BoxLayout:
size_hint_y:0.25
orientation:'horizontal'
Button:
text:'Confirm'
on_release: root.on_rtm()
Button:
text:'Cancel'
on_release: root.dismiss()
Button:
size_hint_y:0.25
text: 'Auto timing'
on_press: root.on_auto(now.now())
<UploadPopup>:
name:name
auto_dismiss: False
title: 'Enter Uploader Name'
size_hint: (1,0.4)
BoxLayout:
orientation: 'vertical'
size:self.parent.size
BoxLayout:
orientation:'horizontal'
size_hint_y:0.5
TextInput:
id: name
background_color: 0,0,0,0
foreground_color: 1,1,1,1
font_size: self.height * 0.5
multiline: False
BoxLayout:
size_hint_y:0.5
orientation:'horizontal'
Button:
text:'Upload'
on_release: root.verify_and_up()
Button:
text:'Cancel'
on_release: root.dismiss()