This repository has been archived by the owner on Feb 7, 2023. It is now read-only.
forked from willm0602/ThymeSaver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.kv
327 lines (258 loc) · 8.41 KB
/
test.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
ScreenManager:
Window1:
Window2:
Login:
Registration:
Recipes:
Pantry:
<Pantry>:
name:"pantry"
MDLabel:
id: no_more_stink
pos_hint: {'center_x':0.85, 'center_y':0.6}
text: "Pantry Screen"
MDRectangleFlatButton:
text: "please, let me leave..."
pos_hint: {'center_x':0.5, 'center_y':0.5}
on_press: root.manager.current = 'window1'
on_press: root.manager.transition.duration = 0.25
<Recipes>:
name:"recipes"
MDLabel:
id: no_more_stink
pos_hint: {'center_x':0.85, 'center_y':0.6}
text: "Recipes Screen"
MDRectangleFlatButton:
text: "please, let me leave..."
pos_hint: {'center_x':0.5, 'center_y':0.5}
on_press: root.manager.current = 'window1'
on_press: root.manager.transition.duration = 0.25
<Registration>:
name:"registration"
MDBoxLayout:
orientation: "vertical"
MDLabel:
text: "Register"
halign: "center"
theme_text_color: "Custom"
text_color: 0, 0.5, 0, 1
#username
MDTextField:
hint_text: "Username"
id: user
halign: "center"
valign: "middle"
color_mode: "primary"
mode: "rectangle"
hint_text_color: "black"
theme_text_color: "Custom"
text_color: 0, 0.5, 0, 1
#password
MDTextField:
hint_text: "Password"
id: password
halign: "center"
valign: "middle"
color_mode: "primary"
mode: "rectangle"
hint_text_color: "black"
theme_text_color: "Custom"
text_color: 0, 0.5, 0, 1
password: True
#email
MDTextField:
hint_text: "Email"
id: email
halign: "center"
valign: "middle"
color_mode: "primary"
mode: "rectangle"
hint_text_color: "black"
theme_text_color: "Custom"
text_color: 0, 0.5, 0, 1
#submit
MDFillRoundFlatButton:
id: "submit"
text: "Register"
font_size: "30"
color: (0, 0.5, 0)
halign: "center"
pos: self.parent.pos
on_release:
root.manager.current = app.sm.get_screen("registration").register(user.text,password.text, email.text)
<Login>:
name:"login"
MDBoxLayout:
orientation: "vertical"
MDLabel:
text: "Login"
halign: "center"
theme_text_color: "Custom"
text_color: 0, 0.5, 0, 1
#username
MDTextField:
hint_text: "Username"
id: user
halign: "center"
valign: "middle"
color_mode: "primary"
mode: "rectangle"
hint_text_color: "black"
theme_text_color: "Custom"
text_color: 0, 0.5, 0, 1
#password
MDTextField:
hint_text: "Password"
id: password
halign: "center"
valign: "middle"
color_mode: "primary"
mode: "rectangle"
hint_text_color: "black"
theme_text_color: "Custom"
text_color: 0, 0.5, 0, 1
password: True
#submit
MDFillRoundFlatButton:
id: "submit"
text: "login"
font_size: "30"
color: (0, 0.5, 0)
halign: "center"
pos: self.parent.pos
on_release:
root.manager.current = app.sm.get_screen("login").login(user.text,password.text)
<Window1>:
name: "window1"
test: no_more_stink
MDLabel:
id: no_more_stink
pos_hint: {'center_x':0.85, 'center_y':0.6}
text: "Welcome Window"
MDRectangleFlatButton:
text: "Login!"
pos_hint: {'center_x':0.5, 'center_y':0.5}
on_press: root.manager.current = 'login'
MDRectangleFlatButton:
text: "Register"
pos_hint: {'center_x':0.5, 'center_y':0.4}
on_press: root.manager.current = 'registration'
MDRectangleFlatButton:
text: "No Thanks"
pos_hint: {'center_x':0.5, 'center_y':0.3}
on_press: root.manager.current = 'window2'
<Window2>:
name: "window2"
container: container
MDBoxLayout:
orientation: "vertical"
spacing: "10dp"
ScrollView:
scroll_timeout: 100
MDList:
id: container
padding:0
MDFloatingActionButtonSpeedDial: #floating list button
id:float_button
callback: self.parent.call_back
data: app.sm.get_screen("window2").data
root_button_anim: True
#rotation_root_button : True #this breaks the whole thing
hint_animation: True
NavigationLayout:
ScreenManager:
Screen:
BoxLayout:
orientation: 'vertical'
MDToolbar:
title: "Yung Money -- The List"
elevation: 10
left_action_items: [['menu', lambda x: nav_drawer.set_state()]]
Widget:
MDNavigationDrawer:
id: nav_drawer
ContentNavigationDrawer:
id: content_drawer
<ItemDrawer>:
theme_text_color: "Custom"
on_press: self.parent.parent.set_state("close")
on_press: self.parent.parent.parent.parent.parent.current = "window1" #this is ugly but it works
IconLeftWidget:
id: icon
icon: root.icon
theme_text_color: "Custom"
text_color: root.text_color
<ContentNavigationDrawer>: #All of the info in the nav drawer
orientation: "vertical"
padding: "8dp"
spacing: "8dp"
AnchorLayout:
anchor_x: "left"
anchor_y: "top"
size_hint_y: None
height: avatar.height
Image: #User image, not necessary but could be cool. Current Captain Wheeze
id: avatar
size_hint: None, None
size: "56dp", "56dp"
source: "CaptainWheezeopp.png"
MDLabel: # This will eventually be the username of the user
text: app.user.username
font_style: "Button"
size_hint_y: None
height: self.texture_size[1]
MDLabel: # and this will be the users email
text: app.user.email
font_style: "Caption"
size_hint_y: None
height: self.texture_size[1]
ScrollView: #This is the nav list in the navbar, probably doesn't need a scrollview
DrawerList:
id: md_list
<SwipeItem>:
size_hint_y: 1
height: content.height
pos_hint: {"center_x": 0.5, "center_y": 0.5}
MDCardSwipeLayerBox:
padding: "8dp"
MDIconButton:
icon: "trash-can"
pos_hint: {"center_y": 0.5}
on_release: self.parent.parent.parent.parent.parent.remove_item(root)
MDIconButton:
icon: "database-plus"
pos_hint: {"center_y": 0.5}
on_release: self.parent.parent.parent.parent.parent.add_pantry_item(root)
MDCardSwipeFrontBox:
OneLineListItem:
id: content
text: root.text
icon: root.icon
_no_ripple_effect: True
RightCheckBox:
on_release: self.CheckedItems(root.text)
<dialog_content>
quantity:quantity
orientation:"vertical"
spaceing: "12dp"
size_hint_y: None
height: "120dp"
MDLabel:
text: "Does this item expire?"
valign: "top"
MDRaisedButton:
text: "Select an expiration date"
pos_hint: {'center_x': .5, 'center_y': .5}
on_release: app.sm.get_screen("window2").show_date_picker()
MDTextField:
id: quantity
input_filter: 'int'
hint_text: "Quantity"
helper_text: "Default:1"
helper_text_mode: "persistent"
#color_mode: 'custom'
#line_color_focus: 0, 1, 0, 1
<Check@MDCheckbox>:
group: 'group'
size_hint: None, None
size: dp(48), dp(48) #48