settings screen

This commit is contained in:
rgarcia-herrera 2020-08-30 14:18:01 -05:00
parent c7c4760c8c
commit 5c0f0d22c9
2 changed files with 99 additions and 9 deletions

View File

@ -17,6 +17,16 @@
background_color: rgba("#c0464b")
<BgSlider@Slider+BackgroundColor>:
background_color: 0, 0, 0, 0
background_color: rgba("#c0464b")
<BgSwitch@Switch+BackgroundColor>:
background_color: 0, 0, 0, 0
background_color: rgba("#c0464b")
<RootScreen>:
MapScreen:
CompassScreen:
@ -25,7 +35,6 @@
<MapScreen>:
FloatLayout:
MapView:
id: mapview
zoom: 16
@ -128,3 +137,75 @@
size_hint: 1, 0.2
pos_hint: {"x": 0, "top": 0.2}
font_size: '40sp'
<SettingsScreen>:
GridLayout:
cols: 2
BackgroundLabel:
text: "Dark theme"
background_color: rgba("#f3e8d2")
color: rgba("#346645")
font_size: '14sp'
BgSwitch:
id: dark_theme
active: True
background_color: rgba("#f3e8d2")
color: rgba("#346645")
BackgroundLabel:
text: "Compas smoothing"
background_color: rgba("#f3e8d2")
color: rgba("#346645")
font_size: '14sp'
BgSlider:
id: slider_smoothing
background_color: rgba("#f3e8d2")
color: rgba("#346645")
min: 0
max: 1
step: 0.1
orientation: 'horizontal'
value: 0.88
BackgroundLabel:
text: "Update frequency"
background_color: rgba("#f3e8d2")
color: rgba("#346645")
font_size: '14sp'
BgSlider:
id: slider_update_freq
background_color: rgba("#f3e8d2")
color: rgba("#346645")
min: 0
max: 1
step: 0.1
orientation: 'horizontal'
value: 0.5
BackgroundLabel:
text: "Local altruism"
background_color: rgba("#f3e8d2")
color: rgba("#346645")
font_size: '14sp'
BgSlider:
id: slider_local_altruism
background_color: rgba("#f3e8d2")
color: rgba("#346645")
min: 0
max: 1
step: 0.1
orientation: 'horizontal'
value: 0.1
BackgroundLabel:
text: "Destination altruism"
background_color: rgba("#f3e8d2")
color: rgba("#346645")
font_size: '14sp'
BgSlider:
id: slider_dest_altruism
background_color: rgba("#f3e8d2")
color: rgba("#346645")
min: 0
max: 1
step: 0.2
orientation: 'horizontal'
value: 0.2

View File

@ -27,6 +27,10 @@ class CompassScreen(Screen):
pass
class SettingsScreen(Screen):
pass
class FlockompassApp(App):
gps_data = DictProperty()
@ -195,6 +199,11 @@ class FlockompassApp(App):
screen_manager.add_widget(self.cs)
self.ss = SettingsScreen(name='settings')
screen_manager.add_widget(self.ss)
# smoothing vars for compass
self.last_angle = 0