Browse Source

Proper name for the window resize event callback; when an avatar is

available, redraw only the visible grid (the other one will be queue for
redraw anyway when the user change tabs.)
master
Julio Biason 14 years ago
parent
commit
0278d4707e
  1. 11
      mitterlib/ui/ui_pygtk.py

11
mitterlib/ui/ui_pygtk.py

@ -33,12 +33,12 @@ from mitterlib.ui.helpers.gtk_threading import ThreadManager
from mitterlib.ui.helpers.gtk_updatebox import UpdateBox
from mitterlib.ui.helpers.gtk_messagegrid import MessageGrid
from mitterlib.constants import gpl_3, version
from mitterlib.ui.helpers import timesince
# ----------------------------------------------------------------------
# Constants
# ----------------------------------------------------------------------
_log = logging.getLogger('ui.pygtk')
URL_RE = re.compile(r'(https?://[^\s\n\r]+)', re.I)
# ----------------------------------------------------------------------
# I18n bits
@ -121,7 +121,7 @@ class Interface(object):
# now that all elements are created, connect the signals
main_window.connect('destroy', self._quit_app)
main_window.connect('delete-event', self._quit_app)
main_window.connect('size-request', self._grid_resize)
main_window.connect('size-request', self._window_resize)
self._update_field.connect('focus-in-event', self._on_textarea_focus)
@ -467,7 +467,7 @@ class Interface(object):
gtk.main_quit()
return
def _grid_resize(self, widget, requisition, data=None):
def _window_resize(self, widget, requisition, data=None):
"""Called when the window is resized. We use it to set the proper
word-wrapping in the message column."""
(win_width, win_height) = self._main_window.get_size()
@ -759,7 +759,8 @@ class Interface(object):
user_pic = user_pic.scale_simple(48, 48, gtk.gdk.INTERP_BILINEAR)
self._avatars[url] = user_pic
(grid, _) = self._grids[0]
page = self._main_tabs.get_current_page()
grid = self._main_tabs.get_nth_page(page)
grid.queue_draw()
return

Loading…
Cancel
Save