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

This commit is contained in:
Yann Leboulanger 2006-07-28 06:40:37 +00:00
parent 40efbfd657
commit 1dcc955551
1 changed files with 11 additions and 1 deletions

View File

@ -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