Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Schampijer <simon@schampijer.de>2011-11-04 08:30:01 (GMT)
committer Simon Schampijer <simon@schampijer.de>2011-11-04 08:30:01 (GMT)
commit696a077d43857b022b857808633f57fc051812de (patch)
tree39bd37609b3897daf864f448bf4c31250939295a
parent280a43dac9a920164d247ca20de889a96a8ca3e0 (diff)
Combobox: Gtk.icon_size_lookup* does return a tulple with a bolean and width and height now
Adjusted the combobox test for that http://developer.gnome.org/gtk/stable/gtk-Themeable-Stock-Images.html#gtk-icon-size-lookup http://developer.gnome.org/gtk/stable/gtk-Themeable-Stock-Images.html#gtk-icon-size-lookup-for-settings
-rw-r--r--examples/combobox.py2
-rw-r--r--src/sugar3/graphics/combobox.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/examples/combobox.py b/examples/combobox.py
index 98d01d5..a712810 100644
--- a/examples/combobox.py
+++ b/examples/combobox.py
@@ -16,7 +16,7 @@ w.add(box)
combo = ComboBox()
combo.append_item(0, 'one')
-combo.append_item(1, 'two')
+combo.append_item(1, 'two', 'go-next')
combo.append_item(2, 'three')
combo.set_active(1)
combo.connect('changed', __combo_changed_cb)
diff --git a/src/sugar3/graphics/combobox.py b/src/sugar3/graphics/combobox.py
index 71b72ba..a87115f 100644
--- a/src/sugar3/graphics/combobox.py
+++ b/src/sugar3/graphics/combobox.py
@@ -61,7 +61,7 @@ class ComboBox(Gtk.ComboBox):
def _get_real_name_from_theme(self, name, size):
icon_theme = Gtk.IconTheme.get_default()
- width, height = Gtk.icon_size_lookup(size)
+ valid, width, height = Gtk.icon_size_lookup(size)
info = icon_theme.lookup_icon(name, max(width, height), 0)
if not info:
raise ValueError('Icon %r not found.' % name)
@@ -90,8 +90,8 @@ class ComboBox(Gtk.ComboBox):
self._icon_renderer = Gtk.CellRendererPixbuf()
settings = self.get_settings()
- w, h = Gtk.icon_size_lookup_for_settings(
- settings, Gtk.IconSize.MENU)
+ valid, w, h = Gtk.icon_size_lookup_for_settings(
+ settings, Gtk.IconSize.MENU)
self._icon_renderer.props.stock_size = max(w, h)
self.pack_start(self._icon_renderer, False)
@@ -107,7 +107,7 @@ class ComboBox(Gtk.ComboBox):
size = Gtk.IconSize.MENU
else:
size = Gtk.IconSize.LARGE_TOOLBAR
- width, height = Gtk.icon_size_lookup(size)
+ valid, width, height = Gtk.icon_size_lookup(size)
if icon_name:
file_name = self._get_real_name_from_theme(icon_name, size)