bigger avatar cannot be shown in a window larger than half the screen
This commit is contained in:
parent
fb4ea9c947
commit
c9a368a163
|
@ -134,8 +134,20 @@ class TabbedChatWindow(chat.Chat):
|
||||||
gobject.source_remove(self.show_bigger_avatar_timeout_id)
|
gobject.source_remove(self.show_bigger_avatar_timeout_id)
|
||||||
|
|
||||||
def show_bigger_avatar(self, widget):
|
def show_bigger_avatar(self, widget):
|
||||||
|
'''resizes the avatar, if needed, so it has at max half the screen size
|
||||||
|
and shows it'''
|
||||||
jid = self.get_active_jid()
|
jid = self.get_active_jid()
|
||||||
avatar_pixbuf = self.plugin.avatar_pixbufs[jid]
|
avatar_pixbuf = self.plugin.avatar_pixbufs[jid]
|
||||||
|
screen_w = gtk.gdk.screen_width()
|
||||||
|
screen_h = gtk.gdk.screen_height()
|
||||||
|
avatar_w = avatar_pixbuf.get_property('width')
|
||||||
|
avatar_h = avatar_pixbuf.get_property('height')
|
||||||
|
half_scr_w = screen_w / 2
|
||||||
|
half_scr_h = screen_h / 2
|
||||||
|
if avatar_w > half_scr_w:
|
||||||
|
avatar_w = half_scr_w
|
||||||
|
if avatar_h > half_scr_h:
|
||||||
|
avatar_h = half_scr_h
|
||||||
window = gtk.Window(gtk.WINDOW_POPUP)
|
window = gtk.Window(gtk.WINDOW_POPUP)
|
||||||
self.bigger_avatar_window = window
|
self.bigger_avatar_window = window
|
||||||
image = gtk.Image()
|
image = gtk.Image()
|
||||||
|
|
Loading…
Reference in New Issue