changeset 82d4a7e724c6 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=82d4a7e724c6 description: [Dicson] Ability to resize statusicon when statusbar changes. Fixes #5911
diffstat:
src/statusicon.py | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-)
diffs (47 lines):
diff -r 80e03420842a -r 82d4a7e724c6 src/statusicon.py --- a/src/statusicon.py Mon Sep 13 12:23:49 2010 +0200 +++ b/src/statusicon.py Thu Sep 16 20:27:54 2010 +0200 @@ -86,12 +86,15 @@ def show_icon(self): if not self.status_icon: self.status_icon = gtk.StatusIcon() + self.statusicon_size = '16' self.status_icon.set_property('has-tooltip', True) self.status_icon.connect('activate', self.on_status_icon_left_clicked) self.status_icon.connect('popup-menu', self.on_status_icon_right_clicked) self.status_icon.connect('query-tooltip', self.on_status_icon_query_tooltip) + self.status_icon.connect('size-changed', + self.on_status_icon_size_changed)
self.set_img() self.status_icon.set_visible(True) @@ -112,6 +115,16 @@ def on_status_icon_left_clicked(self, widget): self.on_left_click()
+ def on_status_icon_size_changed(self, statusicon, size): + if size > 31: + self.statusicon_size = '32' + else: + self.statusicon_size = '16' + if os.environ.get('KDE_FULL_SESSION') == 'true': + # detect KDE session. see #5476 + self.statusicon_size = '32' + self.set_img() + def set_img(self): """ Apart from image, we also update tooltip text here @@ -123,8 +136,8 @@ else: self.status_icon.set_blinking(False)
- # FIXME: do not always use 16x16 (ask actually used size and use that) - image = gajim.interface.jabber_state_images['16'][self.status] + image = gajim.interface.jabber_state_images[self.statusicon_size][ + self.status] if image.get_storage_type() == gtk.IMAGE_PIXBUF: self.status_icon.set_from_pixbuf(image.get_pixbuf()) # FIXME: oops they forgot to support GIF animation?