This repository has been archived by the owner on Nov 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenuscreen.kv
228 lines (192 loc) · 4.99 KB
/
menuscreen.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
# -----
# activity booking widgets
# -----
# activity booking toggle behaviour
<ActivityToggleBehavior>:
group: "activity_picker"
allow_no_selection: False # no activity is included as an option
# layout with information and booking toggle for one activity
<ActivityBlock>:
orientation: "vertical"
padding: 3
size_hint: 1, 1
size_hint_max_x: 275
border_color: 0, 0, 0, 0
canvas:
Color:
rgba: root.border_color
Line:
rectangle: (*root.pos, *root.size)
width: 1.5
Image:
size_hint_y: None
# for horizontal alignment of images across all blocks
height: self.width
source: root.img
MainLabel: # activity name label
size: self.texture_size
text: root.name
color: white
MainLabel: # activity rating label
pos_hint: {"center_x": .5}
height: self.texture_size[1]
text: "Rating: " + root.rating
font_size: "18dp"
color: grey_light
AlignLabel: # activity description label
size_hint_y: 1
valign: "top"
text: root.desc
font_size: 15
color: grey_light
MainLabel: # activity price label
pos_hint: {"center_x": .5}
text: "Price: ${:.2f}".format(root.price)
color: grey_light
# contains all activities available for given day
<ActivityLayout>:
padding: 5
spacing: 10
pos_hint: {"center_x": .5}
# popup with layout containing all activities available for given day
<ActivityPicker>:
size_hint: .9, .9
# -----
# meal booking widgets
# -----
# similar to their activity booking counterparts
<MealBlock>:
group: "meal_picker"
allow_no_selection: False
orientation: "vertical"
padding: 3
size_hint: 1, 1
size_hint_max_x: 275
border_color: 0, 0, 0, 0
canvas:
Color:
rgba: root.border_color
Line:
rectangle: (*root.pos, *root.size)
width: 1.5
Image:
height: self.width
source: root.img
MainLabel:
size: self.texture_size
text: root.name
color: white
AlignLabel:
size_hint_y: 1
valign: "top"
text: root.desc
font_size: 15
color: grey_light
<MealLayout>:
padding: 5
spacing: 10
pos_hint: {"center_x": .5}
<MealPicker>:
size_hint: .9, .9
# -----
# building blocks of calendar layout
# -----
<BookButton>:
canvas.before:
Color:
rgba: white_trans
Rectangle:
size: self.size
pos: self.pos
background_normal: "res/book_btn_normal.png"
background_down: "res/book_btn_down.png"
size_hint: None, None
size: 28, 28
pos_hint: {"right": 1, "top": 1}
<CalendarSubBlock>:
day: 0
name: ''
img: ''
Image:
id: image
canvas.after:
Color:
rgba:
white_trans if root.unavailable else transparent
Rectangle:
id: mask
size: self.size
pos: self.pos
source: root.img
pos_hint: {"left": 0, "top": 1}
MainLabel:
canvas.before:
Color:
rgba: white_trans
Rectangle:
size: self.size
pos: self.pos
padding: 3, 3
font_size: "18dp"
color: grey_dark
text: root.name
text_size: root.width, None
pos_hint: {"left": 0, "bottom": 0}
# block containing activity and meal sub-block for one day
<CalendarBlock>:
day: 0
doc: ''
orientation: "vertical"
padding: 8
spacing: 5
canvas:
Color:
rgba: 0, 0, 0, .1
Rectangle:
size: self.size
pos: self.pos
AlignLabel: # show the number of day in calendar
id: day_label
halign: "center"
text: '[b]' + str(root.day) + '[/b]' + root.doc
color: grey
# call on activity booking popup for the day
CalendarActivityBlock:
id: activity_btn
day: root.day
size_hint: 1, 1
# call on meal booking popup for the day
CalendarMealBlock:
id: meal_btn
day: root.day
size_hint: 1, 1
<CalendarLayout>:
cols: 7
padding: 10
spacing: 18
<MenuScreen>:
username: ''
name: "menu"
BoxLayout:
orientation: "vertical"
MainBanner: # top bar
MainHeading:
heading: "Menu"
HeadingButton:
name: "cost"
on_release: root.to_cost()
HeadingButton:
name: "profile"
on_release: root.to_profile()
HeadingButton:
name: "logout"
on_release: root.logout()
HelpButton:
screen: root.name
AlignLabel:
height: 65
text: "Welcome aboard Kimberley Quest, {}!".format(root.username)
color: grey
left: 0
CalendarLayout:
id: calendar