From 267a9135667e88f1e775a8078420a949dacc1a7b Mon Sep 17 00:00:00 2001 From: Huang Peng Date: Tue, 3 Jun 2008 22:07:43 +0800 Subject: [PATCH] Try to use custom icons. --- panel/languagebar.py | 17 ++++++++++------- panel/panel.py | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/panel/languagebar.py b/panel/languagebar.py index 00ee54e2..fe6730fa 100644 --- a/panel/languagebar.py +++ b/panel/languagebar.py @@ -8,20 +8,23 @@ class LanguageBar (gtk.Toolbar): def __init__ (self): gtk.Toolbar.__init__ (self) self.set_property ("icon-size", gtk.ICON_SIZE_MENU) + icon_theme = gtk.icon_theme_get_default () + icon_theme.prepend_search_path ("/home/phuang/sources/ibus/icons") # self.set_orientation (gtk.ORIENTATION_VERTICAL) self._create_items () - def insert (self, toolitem, pos): - gtk.Toolbar.insert (self, toolitem, pos) - self.check_resize () - def _add_items (self): - btn = gtk.ToolButton (gtk.STOCK_NEW) + img = gtk.image_new_from_icon_name ("engine-default", gtk.ICON_SIZE_MENU) + btn = gtk.ToolButton (img, "engine") btn.connect ("clicked", lambda x: self._add_items ()) self.insert (btn, -1) - self.insert (gtk.ToolButton (gtk.STOCK_APPLY), -1) + + img = gtk.image_new_from_icon_name ("ibus-keyboard", gtk.ICON_SIZE_MENU) + btn = gtk.ToolButton (img, "keyboard") + self.insert (btn, -1) self.insert (gtk.SeparatorToolItem (), -1) self.show_all () + self.check_resize () def _create_items (self): handle = Handle () @@ -40,7 +43,7 @@ class LanguageBar (gtk.Toolbar): for item in self: w, h = item.size_request () width += w - self.set_size_request (width + 2, -1) + self.set_size_request (width, -1) gobject.type_register (LanguageBar, "IBusLanguageBar") diff --git a/panel/panel.py b/panel/panel.py index 2194f5c6..fbcabb1b 100644 --- a/panel/panel.py +++ b/panel/panel.py @@ -105,5 +105,5 @@ class PanelProxy (interface.IPanel): self._panel.reset () def Destroy (self): - self._pabel.destroy () + self._panel.destroy ()