Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
example_meal_ordering_app
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Brady James Garvin
example_meal_ordering_app
Commits
cee318da
Commit
cee318da
authored
8 years ago
by
Brady James Garvin
Browse files
Options
Downloads
Patches
Plain Diff
Initial commit.
parents
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
main.py
+25
-0
25 additions, 0 deletions
main.py
order.kv
+111
-0
111 additions, 0 deletions
order.kv
with
136 additions
and
0 deletions
main.py
0 → 100644
+
25
−
0
View file @
cee318da
from
kivy.app
import
App
from
kivy.modules
import
inspector
from
kivy.core.window
import
Window
from
kivy.properties
import
BooleanProperty
__app_package__
=
'
edu.unl.cse.soft161.order
'
__app__
=
'
Order Meal
'
__version__
=
'
0.1
'
__flags__
=
[
'
--bootstrap=sdl2
'
,
'
--requirements=python2,kivy
'
,
'
--orientation=landscape
'
]
class
OrderApp
(
App
):
extra_charge
=
BooleanProperty
(
False
)
def
build
(
self
):
inspector
.
create_inspector
(
Window
,
self
)
def
update_charge
(
self
):
self
.
extra_charge
=
self
.
root
.
ids
.
sauce_slider
.
value
>
50
or
\
self
.
root
.
ids
.
cheese_slider
.
value
>
50
or
\
self
.
root
.
ids
.
toppings_slider
.
value
>
50
if
__name__
==
'
__main__
'
:
app
=
OrderApp
()
app
.
run
()
This diff is collapsed.
Click to expand it.
order.kv
0 → 100644
+
111
−
0
View file @
cee318da
BoxLayout:
canvas.before:
Color:
rgba: (0.25, 0, 0, 1)
Rectangle:
pos: self.pos
size: self.size
orientation: 'vertical'
Label:
text: 'Personal Pizza'
font_size: '48sp'
color: (0.8, 0, 0, 1)
BoxLayout:
orientation: 'horizontal'
Label:
text: 'Sauce'
size_hint: 1, None
size: self.texture_size
Label:
id: sauce_label
size_hint: 1, None
size: self.texture_size
text: str(int(sauce_slider.value)) + '%'
BoxLayout:
orientation: 'horizontal'
Widget:
size_hint: 0.05, 1
Label:
text: 'Less'
size_hint: None, 1
size: self.texture_size
Slider:
id: sauce_slider
range: (0, 100)
value: 45
on_value: app.update_charge()
Label:
text: 'More'
size_hint: None, 1
size: self.texture_size
Widget:
size_hint: 0.05, 1
BoxLayout:
orientation: 'horizontal'
Label:
text: 'Cheese'
size_hint: 1, None
size: self.texture_size
Label:
id: cheese_label
size_hint: 1, None
size: self.texture_size
text: str(int(cheese_slider.value)) + '%'
BoxLayout:
orientation: 'horizontal'
Widget:
size_hint: 0.05, 1
Label:
text: 'Less'
size_hint: None, 1
size: self.texture_size
Slider:
id: cheese_slider
range: (0, 100)
value: 30
on_value: app.update_charge()
Label:
text: 'More'
size_hint: None, 1
size: self.texture_size
Widget:
size_hint: 0.05, 1
BoxLayout:
orientation: 'horizontal'
Label:
text: 'Toppings'
size_hint: 1, None
size: self.texture_size
Label:
id: toppings_label
size_hint: 1, None
size: self.texture_size
text: str(int(toppings_slider.value)) + '%'
BoxLayout:
orientation: 'horizontal'
Widget:
size_hint: 0.05, 1
Label:
text: 'Fewer'
size_hint: None, 1
size: self.texture_size
Slider:
id: toppings_slider
range: (0, 100)
value: 20
on_value: app.update_charge()
Label:
text: 'More'
size_hint: None, 1
size: self.texture_size
Widget:
size_hint: 0.05, 1
BoxLayout:
orientation: 'horizontal'
Label:
text: 'Extra Charge'
font_size: '24sp'
color: (0.8, 0, 0, 1)
Label:
font_size: '24sp'
text: '$0.50' if app.extra_charge else '$0.00'
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment