Scollable Options in Settings panel

Jean-Pierre Schnyder edited this page Feb 26, 2018 · 2 revisions


  • author: Thica
  • kivy: >= 1.40

Hello all,

I would like to share a short snippet, if you need more options than fits on the screen. The original kivy options settings will scale outside screen dimensions, if you have a larger numeber of options:


  1. We need to have a new class based on SettingOptions

class SettingScrollOptions(SettingOptions):

    def _create_popup(self, instance):
        #global oORCA
        # create the popup
        content         = GridLayout(cols=1, spacing='5dp')
        scrollview      = ScrollView( do_scroll_x=False)
        scrollcontent   = GridLayout(cols=1,  spacing='5dp', size_hint=(None, None))
        self.popup   = popup = Popup(content=content, title=self.title, size_hint=(0.5, 0.9),  auto_dismiss=False)

        #we need to open the popup first to get the metrics
        #Add some space on top
        content.add_widget(Widget(size_hint_y=None, height=dp(2)))
        # add all the options
        uid = str(self.uid)
        for option in self.options:
            state = 'down' if option == self.value else 'normal'
            btn = ToggleButton(text=option, state=state, group=uid, size=(popup.width, dp(55)), size_hint=(None, None))

        # finally, add a cancel button to return on the previous panel
        #btn = Button(text='Cancel', size=((oORCA.iAppWidth/2)-sp(25), dp(50)),size_hint=(None, None))
        btn = Button(text='Cancel', size=(popup.width, dp(50)),size_hint=(0.9, None))

  1. Register new class to settings widget

        Setting = Settings()
        settings.register_type('scrolloptions', SettingScrollOptions)
  1. Replace "type": "options", against "type": "scrolloptions",


##Comments ######## Add your comments here

Here are part of the required imports: from kivy.uix.settings import SettingOptions from kivy.uix.gridlayout import GridLayout from kivy.uix.scrollview import ScrollView from kivy.uix.widget import Widget from kivy.uix.togglebutton import ToggleButton from kivy.uix.settings import SettingSpacer from kivy.uix.button import Button from kivy.metrics import dp

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.