Skip to content

Commit

Permalink
renamed BusKillSettingsComplexOptionsScreen to just be ComplexOptions…
Browse files Browse the repository at this point in the history
…Screen
  • Loading branch information
maltfield committed Jun 11, 2023
1 parent fa4301a commit 214a5cb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/buskill.kv
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@
# Label:
# text: "BusKillComplexOptions Label"

<BusKillSettingsComplexOptionsScreen>:
<ComplexOptionsScreen>:

color_main_bg: 0.188, 0.188, 0.188, 1
color_primary: 0.129, 0.588, 0.953, 1
Expand Down
12 changes: 10 additions & 2 deletions src/buskill_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ def _choose_settings_screen(self, instance):
# there is no sub-screen for this Complex Option yet; create it

# create new screen for picking the value for this ComplexOption
setting_screen = BusKillSettingsComplexOptionsScreen(
setting_screen = ComplexOptionsScreen(
name = screen_name
)

Expand Down Expand Up @@ -690,19 +690,27 @@ def _choose_settings_screen(self, instance):
manager.transition.direction = 'left'
manager.current = screen_name

# We define BusKillSettings (which extends the built-in kivy Settings) so that
# we can add a new type of Setting = 'commplex-options'). The 'complex-options'
# type becomes a new 'type' that can be defined in our settings json file
class BusKillSettings(kivy.uix.settings.Settings):

def __init__(self, *args, **kargs):
super(BusKillSettings, self).__init__(*args, **kargs)
super(BusKillSettings, self).register_type('complex-options', BusKillSettingComplexOptions)

# Kivy's SettingsWithNoMenu is their simpler settings widget that doesn't
# include a navigation bar between differnt pages of settings. We extend that
# type with BusKillSettingsWithNoMenu so that we can use our custom
# BusKillSettings class (defined above) with our new 'complex-options' type
class BusKillSettingsWithNoMenu(BusKillSettings):

def __init__(self, *args, **kwargs):
self.interface_cls = kivy.uix.settings.ContentPanel
super(BusKillSettingsWithNoMenu,self).__init__( *args, **kwargs )

class BusKillSettingsComplexOptionsScreen(Screen):
# The ComplexOptionsScreen
class ComplexOptionsScreen(Screen):

actionview = ObjectProperty(None)
settings_content = ObjectProperty(None)
Expand Down

0 comments on commit 214a5cb

Please sign in to comment.