[caribou/introspection: 6/10] Things are working!



commit df407f733a8a7e1edc85a0269c6682b7008746cb
Author: Eitan Isaacson <eitan monotonous org>
Date:   Thu Dec 30 23:22:56 2010 -0800

    Things are working!

 caribou/ui/keyboard.py |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/caribou/ui/keyboard.py b/caribou/ui/keyboard.py
index ccb898f..0ba954f 100644
--- a/caribou/ui/keyboard.py
+++ b/caribou/ui/keyboard.py
@@ -79,12 +79,11 @@ class BaseKey(object):
             self.set_relief(Gtk.ReliefStyle.NONE)
             self.set_sensitive(False)
         elif self.key_type == const.PREFERENCES_KEY_TYPE:
-            #image = Gtk.Image()
-            #image.set_from_stock(Gtk.STOCK_PREFERENCES,
-            #                     Gtk.IconSize.BUTTON)
-            #self.set_image(image)
-            self.connect('map', self._on_image_key_mapped)
-            #self.connect('style-updated', self._style_updated)
+            image = Gtk.Image()
+            image.set_from_stock(Gtk.STOCK_PREFERENCES,
+                                 Gtk.IconSize.BUTTON)
+            self.set_image(image)
+            #self.connect('map', self._on_image_key_mapped)
         else:
             if label:
                 label_markup = Gtk.Label()
@@ -160,6 +159,9 @@ class Key(Gtk.Button, BaseKey):
         child = self.get_child()
         if isinstance(child, Gtk.Label):
             child.modify_font(Pango.font_description_from_string(font))
+        elif isinstance(child, Gtk.Image):
+            self.remove(child)
+        if child is not None:
             child.queue_resize()
 
     def reset_font(self):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]