-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom_menus.kv
362 lines (315 loc) · 11.8 KB
/
custom_menus.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
#: kivy 2.0.0
#: import Window kivy.core.window.Window
#: import Clock kivy.clock.Clock
#:import Factory kivy.factory.Factory
#: import wx wx
#: import base64 base64
#: import json json
#: import Snackbar kivymd.uix.snackbar.Snackbar
#: import MDTextField kivymd.uix.textfield.MDTextField
<menu1>:
id: layout
AppMenu:
canvas.before:
Color:
rgba: (219/255, 10/255, 91/255, 1)
Rectangle:
size: self.size
pos: self.pos
cancel_handler_widget: layout
id: app_menu
top: Window.height
height: dp(30)
AppMenuTextItem:
id: m1
background_normal: ""
background_down: ""
background_color: (120/255, 29/255, 74/255, 0.8) if self.state == 'down' else (219/255, 10/255, 91/255, 1)
background_disabled_normal: ""
background_disabled_down: ""
border: (1, 0, 0, 1)
text: "All Encoding Schemes"
color: (11/255, 214/255, 139/255, 1)
ContextMenu:
hl_color: (0, 1, 0, 1)
ContextMenuTextItem:
text: "Base64"
ContextMenu:
hl_color : (1,0,0,1)
ContextMenuTextItem:
color : (0,0,1,1)
background_color: (1, 0, 0, 1)
text: "Encode"
on_press : app.go_to("encb64")
ContextMenuTextItem:
color : (0,0,1,1)
text: "Decode"
on_press : app.go_to("decb64")
ContextMenuTextItem:
text: "Binary"
ContextMenu:
hl_color: (1, 0, 0, 1)
ContextMenuTextItem:
color : (0,0,1,1)
text: "Encode"
on_press : app.go_to("encbin")
ContextMenuTextItem:
color : (0,0,1,1)
text: "Decode"
on_press : app.go_to("decbin")
ContextMenuTextItem:
text: "Rot13"
ContextMenu:
hl_color: (1, 0, 0, 1)
ContextMenuTextItem:
color : (0,0,1,1)
text: "Encode"
on_press : app.go_to("encrot13")
ContextMenuTextItem:
color : (0,0,1,1)
text: "Decode"
on_press : app.go_to("decrot13")
ContextMenuTextItem:
text: "Hex"
ContextMenu:
hl_color: (1, 0, 0, 1)
ContextMenuTextItem:
color : (0,0,1,1)
text: "Encode"
on_press : app.go_to("enchex")
ContextMenuTextItem:
color : (0,0,1,1)
text: "Decode"
on_press : app.go_to("dechex")
AppMenuTextItem:
id: m3
background_normal: ""
background_down: ""
background_color: (120/255, 29/255, 74/255, 0.8) if self.state == 'down' else (219/255, 10/255, 91/255, 1)
background_disabled_normal: ""
background_disabled_down: ""
border: (1, 0, 0, 0)
text: "Settings"
color: (11/255, 214/255, 139/255, 1)
ContextMenu:
hl_color: (0, 1, 0,1)
ContextMenuTextItem:
text: "Screen Transition Time"
on_press:
Factory.transTime().open()
app_menu.close_all()
AppMenuTextItem:
id: m4
background_normal: ""
background_down: ""
background_color: (120/255, 29/255, 74/255, 0.8) if self.state == 'down' else (219/255, 10/255, 91/255, 1)
background_disabled_normal: ""
background_disabled_down: ""
border: (1, 0, 0, 0)
text: "Account"
color: (11/255, 214/255, 139/255, 1)
ContextMenu:
hl_color: (0, 1, 0,1)
ContextMenuTextItem:
text: "Account Settings"
on_press:
app_menu.close_all()
app.log()
ContextMenuTextItem:
text: "View Stats"
on_press:
Factory.Stats().open()
app_menu.close_all()
ContextMenuTextItem:
text: "Change Avatar"
on_press:
app.go_to("avatars")
app_menu.close_all()
ContextMenuTextItem:
text: "Logout"
id: logout
on_press:
app.logout()
app_menu.close_all()
AppMenuTextItem:
id : m5
background_normal: ""
background_down: ""
background_color: (120/255, 29/255, 74/255, 0.8) if self.state == 'down' else (219/255, 10/255, 91/255, 1)
background_disabled_normal: ""
background_disabled_down: ""
border: (0, 0, 0, 0)
text: "Options"
color: (11/255, 214/255, 139/255, 1)
ContextMenu:
hl_color: (0,1,0,1)
ContextMenuTextItem:
text: "Encode Clipboard"
disabled: False
on_press: app.enc_clip()
id: enc_btn
ContextMenuTextItem:
text: "Decode Clipboard"
disabled: False
on_press: app.enc_clip()
id: dec_btn
ContextMenuTextItem:
id: go_other
text: "Go To Other Method in This Encoding Scheme"
disabled: False
on_press: app.go_to_other()
ContextMenuTextItem:
text: "Back To Main Menu"
on_press: app.back_to_main()
id: back_to_main
ContextMenuTextItem:
id: close
text: "Exit App"
on_press:
Clock.schedule_once(lambda x: app.stop(), 2)
self.text = "The App Is Closing..."
self.disabled = True
back_to_main.disabled = True
go_other.disabled = True
dec_btn.disabled = True
enc_btn.disabled = True
AppMenuTextItem:
id: m6
background_normal: ""
background_down: ""
background_color: (120/255, 29/255, 74/255, 0.8) if self.state == 'down' else (219/255, 10/255, 91/255, 1)
background_disabled_normal: ""
background_disabled_down: ""
border: (1, 0, 0, 0)
text: "Help"
color: (11/255, 214/255, 139/255, 1)
ContextMenu:
hl_color : (0, 1, 0,1)
ContextMenuTextItem:
text: "Report A Bug On Github"
on_press:
import webbrowser
import logging
webbrowser.open("https://github.com/Elon-Musk-YAY/Data-Encoder-MacOS/issues/new")
app_menu.close_all()
ContextMenuTextItem:
text: "Credits And Copyright"
on_press: app.go_to("credits", "right"); app_menu.close_all()
ContextMenuTextItem:
id: what_new
text: "What's New in Data Encoder?"
on_press:
Factory.Pop().open()
app_menu.close_all()
<Pop>:
id: popup
auto_dismiss: True
title: "What's New in Data Encoder 2021.1.11?"
size_hint: (None, None)
size: (Window.width-125, Window.height-125)
separator_color: (0, 1, 0, 1)
content: lay
GridLayout:
id: lay
cols: 1
Label:
text: "A new menu bar at the top!"
Label:
text: "Credits And Copyright"
Label:
text: "More Encoding And Decoding Types!"
Label:
text: "App is More Efficient with Certain Tasks"
Label:
text: "Stats!"
Label:
text: "Accounts"
Label:
text: "Avatars"
Button:
text: "Close"
on_press: popup.dismiss()
background_color: (1,0,0,1)
<Stats>:
id: Stats
auto_dismiss: True
title: "Your Stats"
size_hint: (None, None)
size: (Window.width - 900, 900)
separator_color: (0, 0, 1, 1)
content: stat_shower
GridLayout:
id: stat_shower
cols: 1
GridLayout:
cols: 2
Label:
text: "Total Times You Have Encoded Data:"
Label:
text: f'{"{:,}".format(int(app.stats["enc_times"]))}' if int(app.stats["enc_times"]) < 1000000000 else f'{float(app.stats["enc_times"])}'
Label:
text: "Total Times You Have Decoded Data:"
Label:
text: f'{"{:,}".format(int(app.stats["dec_times"]))}' if int(app.stats["dec_times"]) < 1000000000 else f'{float(app.stats["dec_times"])}'
Label:
text: "Total Times You Have Encoded Or Decoded Data:"
Label:
text: f'{"{:,}".format(int(app.stats["total_times"]))}' if int(app.stats["total_times"]) < 1000000000 else f'{float(app.stats["total_times"])}'
Button:
text: "Close"
on_press: Stats.dismiss()
background_color: (1, 0,0,1)
<transTime>:
id: trans
auto_dismiss: True
title: "Set Screen Transition Time"
color: (1,0,0,1)
size_hint: (None, None)
size: (Window.width - 300, 900)
separator_color: (1, 0, 0, 1)
content: yes
GridLayout:
id: yes
cols: 1
Label:
id: lab
text: "Please enter the new screen transition time. (MUST BE BETWEEN 0.1 AND 10)"
color: (1,0,0,1)
Label:
text: root.che()
color: (0,1,0,1)
MDTextField:
id: inp
current_hint_text_color: (0, 1,0 ,1)
hint_text: "Enter the value here and press enter when you are done!"
multiline: False
line_color_normal: (1,1,0,1)
line_color_focus: (1,0,1,1)
helper_text_mode: "on_focus"
helper_text: "The text you enter should just be a number."
on_text_validate:
root.check_text(self, lab)
Button:
text: "Close"
on_press:
root.dismiss()
background_color: (1, 0,0,1)
<changeAvatarScreen>:
GridLayout:
cols: 1
Label:
text: "Click on an avatar to select it. NOTE: If you don't log in, your current preferences and stats will not be saved!"
ScrollView:
GridLayout:
cols: 3
id: avatar_grid
size_hint_y: None
height: self.minimum_height
row_default_height: "100dp"
row_force_default: True
spacing: 40, 40
padding: 40, 40
Button:
text: "Back"
background_color: (1,0,0,1)
on_press: app.go_to("menu","right")