InputDeviceSetup: use 20% of list with for sliders
authorMirakels <mirakels@openpli.org>
Fri, 25 Oct 2013 20:51:54 +0000 (22:51 +0200)
committerMirakels <mirakels@openpli.org>
Fri, 25 Oct 2013 20:54:02 +0000 (22:54 +0200)
setSeperation length was hardcoded resulting in issues for
localised string (not enough room).
Limiting the size of the sliders minimises the change of
limited space for translated strings.

lib/python/Screens/InputDeviceSetup.py

index 073eb14..f254dd0 100644 (file)
@@ -187,12 +187,14 @@ class InputDeviceSetup(Screen, ConfigListScreen):
 
        def layoutFinished(self):
                self.setTitle(self.setup_title)
+               listWidth = self["config"].l.getItemSize().width()
+               # use 20% of list width for sliders
+               self["config"].l.setSeperation(int(listWidth*.8))
 
        def cleanup(self):
                iInputDevices.currentDevice = ""
 
        def createSetup(self):
-               self.list = [ ]
                label = _("Change repeat and delay settings?")
                cmd = "self.enableEntry = getConfigListEntry(label, config.inputDevices." + self.inputDevice + ".enabled)"
                exec (cmd)
@@ -223,7 +225,6 @@ class InputDeviceSetup(Screen, ConfigListScreen):
                                self["config"].invalidate(self.nameEntry)
 
                self["config"].list = self.list
-               self["config"].l.setSeperation(600)
                self["config"].l.setList(self.list)
                if not self.selectionChanged in self["config"].onSelectionChanged:
                        self["config"].onSelectionChanged.append(self.selectionChanged)