don't scroll to end each time we press a key in message textview, but only when scrollbar appear. fixes #2944

This commit is contained in:
Yann Leboulanger 2007-01-28 14:20:37 +00:00
parent d83d744a27
commit 7d8f7e2a6e
1 changed files with 9 additions and 5 deletions

View File

@ -717,11 +717,15 @@ class ChatControlBase(MessageControl):
if diff_y != 0: if diff_y != 0:
if conversation_height + diff_y < min_height: if conversation_height + diff_y < min_height:
if message_height + conversation_height - min_height > min_height: if message_height + conversation_height - min_height > min_height:
self.msg_scrolledwindow.set_property('vscrollbar-policy', policy = self.msg_scrolledwindow.get_property(
gtk.POLICY_AUTOMATIC) 'vscrollbar-policy')
self.msg_scrolledwindow.set_property('height-request', # scroll only when scrollbar appear
message_height + conversation_height - min_height) if policy != gtk.POLICY_AUTOMATIC:
self.bring_scroll_to_end(msg_textview) self.msg_scrolledwindow.set_property('vscrollbar-policy',
gtk.POLICY_AUTOMATIC)
self.msg_scrolledwindow.set_property('height-request',
message_height + conversation_height - min_height)
self.bring_scroll_to_end(msg_textview)
else: else:
self.msg_scrolledwindow.set_property('vscrollbar-policy', self.msg_scrolledwindow.set_property('vscrollbar-policy',
gtk.POLICY_NEVER) gtk.POLICY_NEVER)