-
Notifications
You must be signed in to change notification settings - Fork 0
/
rm.kv
488 lines (443 loc) · 22.1 KB
/
rm.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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
#:import Window kivy.core.window.Window
#:import get_hex_from_color kivy.utils.get_hex_from_color
#:import icon iconfonts
<BubbleContent>:
opacity: .5 if self.disabled else .8
orientation: "horizontal"
canvas:
BorderImage:
border: self.border
source: self.background_image
size: self.size
pos: self.pos
auto_scale: self.border_auto_scale
<BubbleButton>:
color: [1,1,1,1]
background_normal: 'atlas://data/images/defaulttheme/bubble_btn'
background_down: 'atlas://data/images/defaulttheme/bubble_btn_pressed'
background_disabled_normal: 'atlas://data/images/defaulttheme/bubble_btn'
background_disabled_down: 'atlas://data/images/defaulttheme/bubble_btn_pressed'
border: (0, 0, 0, 0)
<MyTextInputCutCopyPaste>:
content: content.__self__
but_cut: cut.__self__
but_copy: copy.__self__
but_paste: paste.__self__
but_selectall: selectall.__self__
size_hint: None, None
size: app.textContextMenuSize
BubbleContent:
id: content
BubbleButton:
id: cut
font_name: app.specialFont if app.specialFont is not None else "Roboto-Regular"
text: app.msg[235]
on_release: root.do('cut')
BubbleButton:
id: copy
font_name: app.specialFont if app.specialFont is not None else "Roboto-Regular"
text: app.msg[236]
on_release: root.do('copy')
BubbleButton:
id: paste
font_name: app.specialFont if app.specialFont is not None else "Roboto-Regular"
text: app.msg[237]
on_release: root.do('paste')
BubbleButton:
id: selectall
font_name: app.specialFont if app.specialFont is not None else "Roboto-Regular"
text: app.msg[238]
on_release: root.do('selectall')
<Interface>:
rgba: self.rgba
image: self.image
canvas.before:
Color:
rgba: self.rgba
Rectangle:
source: self.image
size: self.size[0], self.size[0]/1.42
pos: self.x, Window.center[1] - self.size[1]/1.42/4#, Window.center[1]#self.pos
<TitleLabel>:
text_size: app.headBox.size
<RoundButton>:
color: (app.tableColor if self == app.positive else app.linkColor) if self.state=='normal' else app.titleColor
background_color: app.roundButtonBGColor
text_size: self.size
text: self.text
rounded: self.rounded
radius: self.radius
r: 37 # закругление центральной кнопки
canvas.before:
Color:
rgba: ((app.globalBGColor if self == app.positive else app.buttonBackgroundColor) if self.state=='normal' else ((app.sortButtonBackgroundColor if self == app.positive else app.roundButtonColorPressed) if app.mode == "light" else app.roundButtonColorPressed2)) if self.text != "" else [0,0,0,0]
SmoothRoundedRectangle:
pos: self.pos
size: self.size
radius: self.radius if self.radius is not None else app.getRadius(rad=100 if not self.rounded else self.r, instance=self)[1]
Color:
rgba: (app.wiredButtonColor if self.state == "normal" else app.titleColor) if self == app.positive and self.text != "" else [0,0,0,0]
SmoothLine:
width: app.thickness()[1]
rounded_rectangle: self.x, self.y, self.width, self.height, self.radius[0] if self.radius is not None else app.getRadius(rad=100 if not self.rounded else self.r, instance=self)[0], 500
<FloatButton>:
color: (app.linkColor if app.button["add_emoji"] not in self.text else app.topButtonColorDarkened) if self.state=='normal' else app.titleColor
background_color: [0,0,0,0]
text_size: self.size
canvas.before:
Color:
rgba: app.floatButtonBGColor if self.state=='normal' else (app.roundButtonColorPressed if app.theme != "gray" else app.roundButtonColorPressed2)
SmoothEllipse:
pos: self.pos
size: self.size
<EmojiButton>:
color: app.linkColor if self.text != app.button['add_emoji'] else [.55, .55, .55, 1]
background_color: [0,0,0,0]
text_size: self.size
canvas.before:
Color:
rgba: app.floatButtonBGColor if self.state == 'normal' else (app.roundButtonColorPressed if app.theme != "gray" else app.roundButtonColorPressed2)
SmoothRoundedRectangle:
pos: self.pos
size: self.size
radius: app.getRadius(1, instance=self)[1]
<RoundColorButton>:
background_color: app.roundButtonBGColor if app.theme != "3D" else [0,0,0,0]
color: [1,1,1,1]
side: self.side
canvas.before:
Color:
rgba: self.color if self.state=='normal' else (app.roundButtonColorPressed if app.theme != "gray" else app.roundButtonColorPressed2)
SmoothEllipse:
pos: self.pos
size: self.size
Color:
rgba: app.floatButtonBGColor if not app.firstCallPopup else ([.6, .6, .6, 1] if app.mode == "light" else [.4, .4, .4, 1])
SmoothLine:
width: (app.thickness()[0] if not app.firstCallPopup else app.thickness()[1]) if self.color == app.getExtraColor(0) else 1
circle: self.center_x, self.center_y, self.size[0]*.5 if self.color == app.getExtraColor(0) else 0
<SquareColorButton>:
background_color: app.roundButtonBGColor if app.theme != "3D" else [0,0,0,0]
color: [1,1,1,1]
side: self.side
canvas.before:
Color:
rgba: self.color if self.state=='normal' else (app.roundButtonColorPressed if app.theme != "gray" else app.roundButtonColorPressed2)
SmoothRoundedRectangle:
pos: self.pos
size: self.size[0], self.size[1]
radius: app.getRadius(250)[1]
Color:
rgba: app.floatButtonBGColor if not app.firstCallPopup else ([.6, .6, .6, 1] if app.mode == "light" else [.4, .4, .4, 1])
SmoothLine:
width: (app.thickness()[0] if not app.firstCallPopup else app.thickness()[1]) if self.color == app.getExtraColor(0) else 1
rounded_rectangle: (self.x, self.y, self.size[0], self.size[1], app.getRadius(250)[0]) if self.color == app.getExtraColor(0) else (0, 0, 0, 0, 0)
<ProgressButton>:
color: [app.titleColor[0], app.titleColor[1], app.titleColor[2], .7]
background_color: [0,0,0,0]
pos: Window.center[0] - self.size[0]/2, Window.center[1] - self.size[1]/2
font_size: app.fontXXL * 1.5
background_normal: ""
background_down: ""
markup: True
canvas.before:
Color:
rgba: [.8,.8,.8,.5] if app.mode == "light" else [.2,.2,.2,.5]
SmoothEllipse:
pos: Window.center[0] - self.size[0] / (1 if not app.desktop else 2), Window.center[1] - self.size[1] / (1 if not app.desktop else 2)
size: self.size[0] * (2 if not app.desktop else 1), self.size[1] * (2 if not app.desktop else 1)
<FirstCallButton>: # базовый класс кнопок первого посещения
text_size: self.size
background_color: [1,1,1,0]
<FirstCallButton1>: # запись
color: ([app.globalBGColor[0], app.globalBGColor[1], app.globalBGColor[2], 1] if app.mode == "dark" else app.linkColor) if self.state == 'normal' else app.titleColor
canvas.before:
Color:
rgba: (app.scrollIconColor if app.mode == "dark" else app.buttonBackgroundColor) if self.state == 'normal' else app.roundButtonColorPressed
SmoothRoundedRectangle:
pos: self.pos
size: self.size
radius: app.FCRadius
<FirstCallButton2>: # нет дома
#color: app.linkColor if self.state == 'normal' else app.titleColor
color: [.95, .95, .95, 1] if self.state == 'normal' else app.titleColor
canvas.before:
Color:
rgba: (app.darkGrayFlat if app.mode == "dark" else [.45, .45, .45, 1]) if self.state == 'normal' else app.roundButtonColorPressed
SmoothRoundedRectangle:
pos: self.pos
size: self.size
radius: app.FCRadius
<FirstCallButton3>: # отказ
color: [1,1,1,.95] if self.state == 'normal' else app.titleColorOnBlack
canvas.before:
Color:
rgba: app.getColorForReject() if self.state=='normal' else app.roundButtonColorPressed
SmoothRoundedRectangle:
pos: self.pos
size: self.size
radius: app.FCRadius
<PopupButton>:
color: app.linkColor if self.state=='normal' else app.titleColor
background_color: 0,0,0,0
text_size: self.size
smooth: self.smooth
canvas.before:
Color:
rgba: [0,0,0,0] if self.state=='normal' else ([1, 1, 1, .5] if app.mode == "light" else (app.popupBGColorPressed if app.theme == "3D" else app.roundButtonColorPressed))
RoundedRectangle:
pos: self.pos
size: self.size if not self.smooth else (0, 0)
radius: app.getRadius(rad=200, instance=self)[1]
SmoothRoundedRectangle:
pos: self.pos
size: self.size if self.smooth else (0, 0)
radius: app.getRadius(rad=200, instance=self)[1]
<PhoneCallButton>:
color: ([.95, .95, .95, 1] if self.state=='normal' else app.titleColor) if app.theme != "3D" else app.getColorForStatus("1")
background_color: [0,0,0,0] if app.theme != "3D" else app.blackTint
text_size: self.size
canvas.before:
Color:
rgba: (app.getColorForStatus("2") if self.state=='normal' else app.roundButtonColorPressed) if app.theme != "3D" else [0,0,0,0]
SmoothRoundedRectangle:
pos: self.pos
size: self.size
radius: [0, 0, app.getRadius(rad=140, instance=self)[0], app.getRadius(rad=140, instance=self)[0]]
<RetroButton>:
text_size: self.size[0], None
<MainMenuButton>:
color: app.mainMenuButtonColor
background_color: app.mainMenuButtonBackgroundColor if app.theme != "3D" else [1,1,1,0]
canvas.before:
Color:
rgba: app.globalBGColor if self.state=='normal' else (app.roundButtonColorPressed if app.mode == "light" else (app.roundButtonColorPressed2 if app.theme != "3D" else app.popupBGColorPressed))
SmoothRoundedRectangle:
pos: self.pos
size: self.size
radius: app.getRadius(200, instance=self)[1]
<TableButton>:
color: app.tableColor if self.state=='normal' else app.titleColor
background_color: app.roundButtonBGColor
canvas.before:
Color:
rgba: app.globalBGColor if self.state=='normal' else (app.roundButtonColorPressed if app.mode == "light" else app.roundButtonColorPressed2)
SmoothRoundedRectangle:
pos: self.pos
size: self.size
radius: app.getRadius(instance=self)[1]
<TerTypeButton>:
text_size: self.size
on: self.on
color: app.titleColor
background_color: app.roundButtonBGColor if app.theme != "3D" else app.blackTint
canvas.before:
Color:
rgba: (([1,1,1,1] if app.mode == "light" else app.scrollButtonBackgroundColor) if self.on else app.globalBGColor) if app.theme != "3D" else [0,0,0,0]
SmoothRoundedRectangle:
pos: self.pos
size: self.size
radius: app.getRadius(instance=self)[1]
<FlatButton>:
color: ([1,1,1,.95] if self.state == "normal" else "white") if (self.number is not None and not "." in self.number) or not app.floors else ((app.getColorForStatus("") if app.mode == "light" else app.getColorForStatus("")) if self.state=='normal' else "white")
background_color: [0,0,0,0]
status: self.status
color2: self.color2
color3: self.color3
text: self.text
flat: self.flat
number: self.number
text_size: (None, None) if app.floors else self.size
k: .32 # размер кружка
squareK: .8 # коэффициент уменьшения квадратика относительно кружка
canvas.before:
Color:
rgba: (app.getColorForStatus(self.status) if self.state=='normal' else app.getColorForStatusPressed(self.status)) if (self.number is not None and not "." in self.number) or not app.floors else ([0,0,0,0] if self.state=='normal' else app.getColorForStatusPressed(self.status))
SmoothRoundedRectangle:
pos: self.pos
size: self.size
radius: app.flatButtonRadius
Color:
rgba: app.getExtraColor(self.color2, self.flat)
SmoothEllipse:
pos: self.pos[0] + 2, self.pos[1] + 2
size: (0,0) if not app.floors else ( (self.size[0]*self.size[1])**self.k*app.fScale, (self.size[0]*self.size[1])**self.k*app.fScale )
Ellipse: # меняем гладкий эллипс на обычный, если перемотка, для решения бага выползающих кружков
pos: self.pos[0] + 2, self.pos[1] + 2
size: (0,0) if app.floors else ( (self.size[0]*self.size[1])**self.k*app.fScale, (self.size[0]*self.size[1])**self.k*app.fScale )
Color:
rgba: app.getExtraColor(self.color3, self.flat)
SmoothRoundedRectangle: # цветной квадратик на сетке подъезда
pos: self.size[0]+self.pos[0] - (self.size[0]*self.size[1])**self.k*app.fScale - 1, self.pos[1] + 2
size: (0,0) if not app.floors else ( (self.size[0]*self.size[1]*self.squareK)**self.k*app.fScale, (self.size[0]*self.size[1]*self.squareK)**self.k*app.fScale )
radius: app.flatButtonColor3Radius
RoundedRectangle: # цветной квадратик на списке
pos: self.size[0]+self.pos[0] - ((self.size[0]*self.size[1])**self.k*app.fScale) - 1, self.pos[1] + 2
size: (0,0) if app.floors else ( (self.size[0]*self.size[1]*self.squareK)**self.k*app.fScale, (self.size[0]*self.size[1]*self.squareK)**self.k*app.fScale )
radius: app.flatButtonColor3Radius
<MyTextInput>:
wired_border: self.wired_border
rounded: self.rounded
popup: self.popup
color: 0, 1, 0, 1
canvas.after:
Color:
rgba: (app.textBorderColorActive if self.focus else app.textBorderColorInactive) if self.wired_border else (0,0,0,0)
SmoothLine:
rounded_rectangle: self.x, self.y, self.width, self.height, app.getRadius(instance=self)[0], 500
width: app.thickness()[1]
<MyTextInputPopup>:
canvas.after:
Color:
rgba: app.textBorderColorActive if self.focus else app.textBorderColorInactiveOnPopup
SmoothLine:
rounded_rectangle: self.x, self.y, self.width, self.height, app.getRadius(instance=self)[0], 500
width: app.thickness()[1]
<ButtonInsideText>:
parentText: self.parentText
color: (app.textBorderColorActive if self.parentText.focus else app.textBorderColorInactiveOnPopup) if self.state=='normal' else app.titleColor
background_color: 0,0,0,0
text_size: self.size
<TipButton>:
text_size: self.size
<TopButton>:
text_size: self.size
color: app.topButtonColor if self.state=='normal' else (app.titleColor if app.theme != "3D" else app.topButtonColor)
background_color: [1,1,1,0]
canvas.before:
Color:
rgba: app.globalBGColor if self.state=='normal' else (app.roundButtonColorPressed if app.mode == "light" else (app.roundButtonColorPressed2 if app.theme != "3D" else app.popupBGColorPressed))
SmoothRoundedRectangle:
pos: self.pos
size: self.size
radius: app.getRadius(instance=self)[1]
<EllipsisButton>:
color: app.topButtonColor if self.state=='normal' else (app.titleColor if app.theme != "3D" else app.topButtonColor)
background_color: [1,1,1,0]
text_size: self.size
canvas.before:
Color:
rgba: app.globalBGColor if self.state=='normal' else (app.roundButtonColorPressed if app.mode == "light" else (app.roundButtonColorPressed2 if app.theme != "3D" else app.popupBGColorPressed))
SmoothRoundedRectangle:
pos: self.pos
size: self.size
radius: app.getRadius(instance=self)[1]
<PinButton>:
pinned: self.pinned
color: (app.titleColor if self.pinned else app.topButtonColor) if self.state=='normal' else (app.titleColor if app.theme != "3D" else app.topButtonColor)
disabled_color: app.pinnedDisabledColor
canvas.before:
Color:
rgba: ((app.pinnedColor if app.theme != "3D" else app.popupBGColorPressed) if self.pinned else app.globalBGColor) if self.state=='normal' else (app.roundButtonColorPressed if app.mode == "light" else (app.roundButtonColorPressed2 if app.theme != "3D" else app.popupBGColorPressed))
SmoothRoundedRectangle:
pos: self.pos
size: self.size
radius: app.getRadius(instance=self)[1]
<Timer>:
background_color: [1,1,1,0]
text_size: self.size
canvas.before:
Color:
rgba: app.globalBGColor if self.state=='normal' else (app.roundButtonColorPressed if app.mode == "light" else (app.roundButtonColorPressed2 if app.theme != "3D" else app.popupBGColorPressed))
SmoothRoundedRectangle:
pos: self.pos
size: self.size
radius: app.getRadius(instance=self)[1]
<TimerLabel>:
text_size: self.size
<TTab>:
text_size: self.size
color: app.tabColors[0] if self.state=='normal' else app.titleColor
<SortListButton>:
color: app.linkColor if self.state=='normal' else (app.titleColor if app.theme != "3D" else app.linkColor)
background_color: app.roundButtonBGColor
text_size: self.size
canvas.before:
Color:
rgba: (app.sortButtonBackgroundColor if self.state=="normal" else app.sortButtonBackgroundColorPressed) if app.theme != "3D" else (0,0,0,0)
RoundedRectangle:
pos: self.pos
size: self.size if app.theme != "3D" else (0,0)
radius: app.sortButtonRadius
<ScrollButton>:
background_color: app.roundButtonBGColor
text_size: self.size
canvas.before:
Color:
rgba: ((app.scrollButtonBackgroundColor if app.disp.form == "ter" or app.disp.form == "con" or (app.disp.form == "houseView" and not app.button['porch_inv'] in self.text) else app.globalBGColor) if self.state == "normal" else (app.roundButtonColorPressed if app.mode == "light" else app.roundButtonColorPressed2)) if app.theme != "3D" else [0,0,0,0]
RoundedRectangle:
pos: self.pos
size: self.size
radius: app.scrollRadius
<MyLabelAligned>:
text_size: self.size
<MyLabelAlignedExpandable>:
size: self.texture_size
<FooterButton>:
color: get_hex_from_color([app.linkColor[0],app.linkColor[1],app.linkColor[2],.9]) if app.mode == "light" else app.standardTextColor
background_color: app.globalBGColor
text_size: [self.size[0], self.size[1]*3]
canvas.before:
Color:
rgba: (app.scrollButtonBackgroundColor if self.state == "normal" else (app.roundButtonColorPressed if app.mode == "light" else app.roundButtonColorPressed2)) if app.theme != "3D" else [0,0,0,0]
RoundedRectangle:
pos: self.pos
size: self.size
radius: app.footerRadius
<RecordButton>:
color: app.standardTextColor
background_color: app.roundButtonBGColor if app.theme != "3D" else [0,0,0,0]
size: self.texture_size
canvas.before:
Color:
rgba: (app.scrollButtonBackgroundColor if self.state == "normal" else (app.roundButtonColorPressed if app.mode == "light" else app.roundButtonColorPressed2)) if app.theme != "3D" else [0,0,0,0]
SmoothRoundedRectangle:
pos: self.pos
size: self.size
radius: app.getRadius(instance=self)[1]
<ColorStatusButton>:
status: self.status
canvas.before:
Color:
rgba: app.getColorForStatus(self.status) if self.state == "normal" else app.getColorForStatusPressed(self.status)
SmoothRoundedRectangle:
pos: self.pos
size: self.size
radius: app.getRadius(rad=150, instance=self)[1]
<FlatFooterLabel>:
text_size: self.size
<FloorView>:
drag_rectangle: self.x, self.y, self.width, self.height
<FontCheckBox>:
text_size: self.size
<NoteButton>:
background_color: app.globalBGColor
radius: self.radius
ratio: (.6 if not app.horizontal else .8) if app.disp.form == 'flatView' else (.17 if app.scrollWidget.cols > 1 else .35)
limit: app.mainList.width * self.ratio
pos_hint: {"center_x": .5} if app.disp.form == "flatView" else {"right": (.89 if not app.horizontal or len(app.disp.options) > 1 else .8)}
size: (self.texture_size[0]*1.12 if self.texture_size[0] < self.limit else self.limit*1.12), self.texture_size[1]*1.1
canvas.before:
Color:
rgba: (app.noteLabelBackgroundColor if self.state=='normal' else (app.roundButtonColorPressed if app.mode == "light" else app.roundButtonColorPressed2)) if app.theme != "3D" else [0,0,0,0]
RoundedRectangle:
pos: self.pos
size: self.size if app.disp.form != "flatView" else (0,0)
radius: self.radius
SmoothRoundedRectangle:
pos: self.pos
size: self.size if app.disp.form == "flatView" else (0,0)
radius: self.radius
<PopupGridLayout>:
alpha: self.alpha
label: self.label
background_color: app.globalBGColor if app.theme != "3D" else 0,0,0,0
canvas.before:
Color:
rgba: [app.popupBackgroundColor[0], app.popupBackgroundColor[1], app.popupBackgroundColor[2], self.alpha] if app.theme != "3D" else [0,0,0,0]
SmoothRoundedRectangle:
pos: self.pos
size: self.size
radius: app.getRadius(rad=200, instance=self)[1]
<MainScroll>:
cols: (1 if Window.size[0] < Window.size[1] else 2) if app.disp.form != "porchView" else app.settings[0][10]