-
Notifications
You must be signed in to change notification settings - Fork 0
/
rm.kv
318 lines (285 loc) · 13.9 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
#:import Window kivy.core.window.Window
#:import get_hex_from_color kivy.utils.get_hex_from_color
<TextInputCutCopyPaste>:
but_cut: cut.__self__
but_copy: copy.__self__
but_paste: paste.__self__
but_selectall: selectall.__self__
size_hint: None, None
size: app.textContextMenuSize
BubbleButton:
id: cut
font_name: app.specialFont if app.specialFont != None else "Roboto-Regular"
text: app.msg[235]
on_release: root.do('cut')
BubbleButton:
id: copy
font_name: app.specialFont if app.specialFont != None else "Roboto-Regular"
text: app.msg[236]
on_release: root.do('copy')
BubbleButton:
id: paste
font_name: app.specialFont if app.specialFont != None else "Roboto-Regular"
text: app.msg[237]
on_release: root.do('paste')
BubbleButton:
id: selectall
font_name: app.specialFont if app.specialFont != None else "Roboto-Regular"
text: app.msg[238]
on_release: root.do('selectall')
<RoundButton@Button>:
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
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]
RoundedRectangle:
pos: self.pos
size: self.size
radius: 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]
Line:
width: app.thickness()[1]
rounded_rectangle: self.x, self.y, self.width, self.height, app.getRadius(rad=100 if not self.rounded else self.r, instance=self)[0], 500
<FloatButton@Button>:
color: (app.linkColor if app.button["add_emoji"] not in self.text else app.topButtonColorDarkened) if self.state=='normal' else app.titleColor
background_color: app.roundButtonBGColor if app.theme != "3D" else [0,0,0,.5]
text_size: self.size
canvas.before:
Color:
rgba: app.floatButtonBGColor if self.state=='normal' else (app.roundButtonColorPressed if app.theme != "gray" else app.roundButtonColorPressed2)
RoundedRectangle:
pos: self.pos
size: self.size
radius: app.getRadius(1, instance=self)[1]
<RoundColorButton@Button>:
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.popupBGColorPressed if app.firstCallPopup else self.color)
Ellipse:
pos: self.pos
size: self.size
Color:
rgba: app.floatButtonBGColor if not app.firstCallPopup else [.4, .4, .4, 1]
Line:
width: (app.thickness()[0] if not app.firstCallPopup else app.thickness()[1]) if self.color == app.getColor2(0) else 1
circle: self.center_x, self.center_y, self.size[0]*.5 if self.color == app.getColor2(0) else 0
<ProgressButton@Button>:
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
text: app.button["wait"]
background_normal: ""
background_down: ""
markup: True
canvas.before:
Color:
rgba: [.8,.8,.8,.5] if app.mode == "light" else [.2,.2,.2,.5]
Ellipse:
size: self.size[0] * (2 if not app.desktop else 1), self.size[1] * (2 if not app.desktop else 1)
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)
<FirstCallButton1@FirstCallButton>: # нет дома
color: app.linkColor if self.state == 'normal' else app.titleColorOnBlack
background_color: [1,1,1,0]
canvas.before:
Color:
rgba: app.popupButtonColor if self.state == 'normal' else app.popupBGColorPressed
RoundedRectangle:
pos: self.pos
size: self.size
radius: app.FCRadius[0]
<FirstCallButton2@FirstCallButton>: # запись
color: app.linkColor if self.state == 'normal' else app.titleColorOnBlack
background_color: [1,1,1,0]
canvas.before:
Color:
rgba: app.popupButtonColor if self.state=='normal' else app.popupBGColorPressed
RoundedRectangle:
pos: self.pos
size: self.size
radius: app.FCRadius[1] if app.settings[0][13] == 1 else app.FCRadius[2]
<FirstCallButton3@FirstCallButton>: # отказ
color: [1,1,1,.95] if self.state == 'normal' else app.titleColorOnBlack
background_color: [1,1,1,0]
canvas.before:
Color:
rgba: app.getColorForReject() if self.state=='normal' else app.popupBGColorPressed
RoundedRectangle:
pos: self.pos
size: self.size
radius: app.FCRadius[3]
<PopupButton@Button>:
color: "lightgray" if self.state=='normal' else app.titleColorOnBlack
background_color: [0,0,0,0] if self.state=='normal' else app.popupBGColorPressed
text_size: self.size
<PopupButtonGray@PopupButton>:
color: "lightgray" if self.state=='normal' else app.titleColorOnBlack
background_color: [.2, .2, .2, 1] if self.state=='normal' else app.popupBGColorPressed
text_size: self.size
<RetroButton@Button>:
text_size: self.size[0], None
<MainMenuButton@Button>:
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))
RoundedRectangle:
pos: self.pos
size: self.size
radius: app.getRadius(80, instance=self)[1]
<TableButton@Button>:
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)
RoundedRectangle:
pos: self.pos
size: self.size
radius: app.getRadius(instance=self)[1]
<TerTypeButton@Button>:
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]
RoundedRectangle:
pos: self.pos
size: self.size
radius: app.getRadius(instance=self)[1]
<FlatButton@Button>:
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.porch.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
text: self.text
flat: self.flat
number: self.number
text_size: (None, None) if app.porch.floors() else self.size
k: .32 # размер кружка
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.porch.floors() else ([0,0,0,0] if self.state=='normal' else app.getColorForStatusPressed(self.status))
RoundedRectangle:
pos: self.pos
size: self.size
radius: app.flatButtonRadius if not app.desktop else [0,]
Color:
rgba: app.getColor2(self.color2, self.flat)
RoundedRectangle:
pos: self.pos[0]+2, self.pos[1]+2
radius: [80,] if app.platform != "win" else [0,]
size: (self.size[0]*self.size[1])**self.k*app.fontScale(), (self.size[0]*self.size[1])**self.k*app.fontScale()
<MyTextInput@TextInput>:
wired_border: self.wired_border
rounded: self.rounded
canvas.after:
Color:
rgba: (app.textBorderColorActive if self.focus else app.textBorderColorInactive) if self.wired_border else (0,0,0,0)
Line:
rounded_rectangle: self.x, self.y, self.width, self.height, app.getRadius(instance=self)[0], 500
width: app.thickness()[1]# * (1.5 if not app.desktop else 1)
<TipButton@Button>:
text_size: self.size
<TopButton@Button>:
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))
RoundedRectangle:
pos: self.pos
size: self.size
radius: app.getRadius(instance=self)[1]
<SettingsButton@Button>:
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))
RoundedRectangle:
pos: self.pos
size: self.size
radius: app.getRadius(instance=self)[1]
<Timer@Button>:
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))
RoundedRectangle:
pos: self.pos
size: self.size
radius: app.getRadius(instance=self)[1]
<TTab@TabbedPanelHeader>:
color: app.tabColors[0] if self.state=='normal' else app.titleColor
text_size: self.size
defaultText: self.defaultText
text: f"{self.defaultText}" if self.state=='normal' else f"[b]{self.defaultText}[/b]"
<_TTab@TabbedPanelHeader>:
color: [.3, 0, 0, 1] if self.state=='normal' else [1, 0, 0, 1]
<SortListButton@Button>:
color: app.linkColor if self.state=='normal' else app.titleColor
background_color: app.sortButtonBackgroundColor if self.state=="normal" else app.sortButtonBackgroundColorPressed
text_size: self.size
<ScrollButton@Button>:
color: app.linkColor
background_color: app.roundButtonBGColor
text_size: self.size
canvas.before:
Color:
rgba: ((app.scrollButtonBackgroundColor if app.displayed.form == "ter" or app.displayed.form == "con" or (app.displayed.form == "houseView" and not app.msg[6] 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
<FooterButton@Button>:
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@Button>:
color: app.standardTextColor
background_color: app.roundButtonBGColor if app.theme != "3D" else [0,0,0,0]
text_size: self.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]
RoundedRectangle:
pos: self.pos
size: self.size
radius: app.getRadius(instance=self)[1]
<ColorStatusButton@Button>:
status: self.status
canvas.before:
Color:
rgba: app.getColorForStatus(self.status) if self.state == "normal" else app.getColorForStatusPressed(self.status)
RoundedRectangle:
pos: self.pos
size: self.size
radius: app.getRadius(rad=150, instance=self)[1]
<FlatFooterLabel@Label>:
text_size: self.size
<FloorView@GridLayout>:
drag_rectangle: self.x, self.y, self.width, self.height
<FontCheckBox@Button>:
text_size: self.size
<MainScroll@GridLayout>:
cols: (1 if Window.size[0] < Window.size[1] or app.displayed.form == "repLog" else 2) if app.displayed.form != "porchView" else app.settings[0][10]