Родитель
aec48ebe3b
Коммит
134bab40bf
|
@ -1 +1,7 @@
|
|||
*.pyc
|
||||
*.la
|
||||
*.lo
|
||||
Makefile
|
||||
Makefile.in
|
||||
.deps
|
||||
.libs
|
||||
|
|
|
@ -10,7 +10,7 @@ class LanguageBar (gtk.Toolbar):
|
|||
self.set_property ("icon-size", gtk.ICON_SIZE_MENU)
|
||||
# self.set_orientation (gtk.ORIENTATION_VERTICAL)
|
||||
self._create_items ()
|
||||
|
||||
|
||||
def insert (self, toolitem, pos):
|
||||
gtk.Toolbar.insert (self, toolitem, pos)
|
||||
self.check_resize ()
|
||||
|
@ -22,7 +22,7 @@ class LanguageBar (gtk.Toolbar):
|
|||
self.insert (gtk.ToolButton (gtk.STOCK_APPLY), -1)
|
||||
self.insert (gtk.SeparatorToolItem (), -1)
|
||||
self.show_all ()
|
||||
|
||||
|
||||
def _create_items (self):
|
||||
handle = Handle ()
|
||||
item = gtk.ToolItem ()
|
||||
|
@ -30,18 +30,18 @@ class LanguageBar (gtk.Toolbar):
|
|||
self.insert (item, -1)
|
||||
|
||||
self._add_items ()
|
||||
|
||||
|
||||
def do_realize (self):
|
||||
gtk.Toolbar.do_realize (self)
|
||||
self.check_resize ()
|
||||
|
||||
|
||||
def do_check_resize (self):
|
||||
width = 0
|
||||
for item in self:
|
||||
w, h = item.size_request ()
|
||||
width += w
|
||||
self.set_size_request (width + 2, -1)
|
||||
|
||||
|
||||
gobject.type_register (LanguageBar, "IBusLanguageBar")
|
||||
|
||||
class LanguageBarWindow (gtk.Window):
|
||||
|
@ -61,7 +61,7 @@ class LanguageBarWindow (gtk.Window):
|
|||
workarea = root.property_get ("_NET_WORKAREA")[2]
|
||||
x, y = workarea[2] - allocation.width - 40, workarea[1] + workarea[3] - allocation.height
|
||||
self.move (x, y)
|
||||
|
||||
|
||||
def do_destroy (self):
|
||||
gtk.main_quit ()
|
||||
gtk.Window.do_destroy (self)
|
||||
|
|
Загрузка…
Ссылка в новой задаче