[Sugar-devel] [PATCH shell] ControlPanel: fix packaging in the keyboard section

Simon Schampijer simon at schampijer.de
Wed Sep 19 03:22:10 EDT 2012


From: Simon Schampijer <simon at laptop.org>

- pack_start: we have to pass all arguments now with the dynamic bindings
- Gtk.ComboBox pack_start only allows for 2 arguments [1]

A follow up is to make displaying the section not crash Sugar anymore
SL #3926.

[1] http://python-gtk-3-tutorial.readthedocs.org/en/latest/combobox.html

Signed-off-by: Simon Schampijer <simon at laptop.org>
---
 extensions/cpsection/keyboard/view.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/extensions/cpsection/keyboard/view.py b/extensions/cpsection/keyboard/view.py
index 587c530..085ec10 100644
--- a/extensions/cpsection/keyboard/view.py
+++ b/extensions/cpsection/keyboard/view.py
@@ -77,9 +77,9 @@ class LayoutCombo(Gtk.HBox):
         cell = Gtk.CellRendererText()
         cell.props.ellipsize = Pango.EllipsizeMode.MIDDLE
         cell.props.ellipsize_set = True
-        self._klang_combo.pack_start(cell, True, True, 0)
+        self._klang_combo.pack_start(cell, True)
         self._klang_combo.add_attribute(cell, 'text', 1)
-        self.pack_start(self._klang_combo, expand=True, fill=True)
+        self.pack_start(self._klang_combo, expand=True, fill=True, padding=0)
 
         self._kvariant_store = None
         self._kvariant_combo = Gtk.ComboBox(model=None)
@@ -89,9 +89,9 @@ class LayoutCombo(Gtk.HBox):
         cell = Gtk.CellRendererText()
         cell.props.ellipsize = Pango.EllipsizeMode.MIDDLE
         cell.props.ellipsize_set = True
-        self._kvariant_combo.pack_start(cell, True, True, 0)
+        self._kvariant_combo.pack_start(cell, True)
         self._kvariant_combo.add_attribute(cell, 'text', 1)
-        self.pack_start(self._kvariant_combo, expand=True, fill=True)
+        self.pack_start(self._kvariant_combo, expand=True, fill=True, padding=0)
 
         self._klang_combo.set_active(self._index)
 
@@ -205,7 +205,7 @@ class Keyboard(SectionView):
         cell = Gtk.CellRendererText()
         cell.props.ellipsize = Pango.EllipsizeMode.MIDDLE
         cell.props.ellipsize_set = True
-        kmodel_combo.pack_start(cell, True, True, 0)
+        kmodel_combo.pack_start(cell, True)
         kmodel_combo.add_attribute(cell, 'text', 1)
 
         self._kmodel = self._keyboard_manager.get_current_model()
@@ -265,7 +265,7 @@ class Keyboard(SectionView):
         cell = Gtk.CellRendererText()
         cell.props.ellipsize = Pango.EllipsizeMode.MIDDLE
         cell.props.ellipsize_set = True
-        group_option_combo.pack_start(cell, True, True, 0)
+        group_option_combo.pack_start(cell, True)
         group_option_combo.add_attribute(cell, 'text', 1)
 
         self._group_switch_option = \
-- 
1.7.11.4



More information about the Sugar-devel mailing list