From a7eba146dd8b153648beccc9f15b17fc846e0c68 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Sun, 13 Dec 2009 20:30:33 -0200 Subject: [PATCH] Move to the first cell on new messages --- mitterlib/ui/ui_pygtk.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mitterlib/ui/ui_pygtk.py b/mitterlib/ui/ui_pygtk.py index d696a7f..8a28162 100644 --- a/mitterlib/ui/ui_pygtk.py +++ b/mitterlib/ui/ui_pygtk.py @@ -903,6 +903,11 @@ class Interface(object): _log.debug('Data: %s', str(message)) store.prepend([message]) store.sort_column_changed() + if len(results) > 0: + # scroll to the first cell, to "show" that there are new items. + iter = self._grid.get_model().get_iter_first() + path = self._grid.get_model().get_path(iter) + self._grid.scroll_to_cell(path) self._grid.queue_draw() # once our update went fine, we can queue the next one. This avoids