Skip to content
Snippets Groups Projects
Commit cee318da authored by Brady James Garvin's avatar Brady James Garvin
Browse files

Initial commit.

parents
No related branches found
No related tags found
No related merge requests found
main.py 0 → 100644
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()
order.kv 0 → 100644
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'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment