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