From 1dcc9555518cf69aa324677780dd96864b3ccd68 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Fri, 28 Jul 2006 06:40:37 +0000 Subject: [PATCH] when we open a second tab and conversation textview was scrolled down in the forst one, scroll it down after we show tabs. Fixes #2190 --- src/message_window.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/message_window.py b/src/message_window.py index b70855e99..d1aa2c6d5 100644 --- a/src/message_window.py +++ b/src/message_window.py @@ -22,6 +22,7 @@ ## import gtk +import gobject import common import gtkgui_helpers @@ -149,8 +150,17 @@ class MessageWindow: fjid = control.get_full_jid() self._controls[control.account][fjid] = control - if self.get_num_controls() > 1: + if self.get_num_controls() == 2: + # is first conversation_textview scrolled down ? + scrolled = False + first_widget = self.notebook.get_nth_page(0) + ctrl = self._widget_to_control(first_widget) + conv_textview = ctrl.conv_textview + if conv_textview.at_the_end(): + scrolled = True self.notebook.set_show_tabs(True) + if scrolled: + gobject.idle_add(conv_textview.scroll_to_end_iter) self.alignment.set_property('top-padding', 2) # Add notebook page and connect up to the tab's close button