From e884cb20ab26bf53525f42650749344ce82b7a63 Mon Sep 17 00:00:00 2001 From: Denis Fomin <fominde@gmail.com> Date: Fri, 23 Aug 2013 18:46:35 +0400 Subject: [PATCH] don't use smooth scrolling when chnging fond or resizing chr window. Fixes #7268 --- src/chat_control.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/chat_control.py b/src/chat_control.py index 4195ce659b..b1dde4ac55 100644 --- a/src/chat_control.py +++ b/src/chat_control.py @@ -1277,14 +1277,20 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): # used to stay at the end of the textview when we shrink conversation # textview. if self.was_at_the_end: - self.conv_textview.bring_scroll_to_end(-18, use_smooth=False) - self.was_at_the_end = (adjustment.upper - adjustment.value - adjustment.page_size) < 18 + if self.conv_textview.at_the_end(): + # we are at the end + self.conv_textview.bring_scroll_to_end(-18) + else: + self.conv_textview.bring_scroll_to_end(-18, use_smooth=False) + self.was_at_the_end = (adjustment.upper - adjustment.value - \ + adjustment.page_size) < 18 def on_conversation_vadjustment_value_changed(self, adjustment): # stop automatic scroll when we manually scroll if not self.conv_textview.auto_scrolling: self.conv_textview.stop_scrolling() - self.was_at_the_end = (adjustment.upper - adjustment.value - adjustment.page_size) < 18 + self.was_at_the_end = (adjustment.upper - adjustment.value - \ + adjustment.page_size) < 18 if self.resource: jid = self.contact.get_full_jid() else: @@ -1328,9 +1334,8 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools): if room_jid in gajim.interface.minimized_controls[self.account]: groupchat_control = \ gajim.interface.minimized_controls[self.account][room_jid] - contact = \ - gajim.contacts.get_contact_with_highest_priority(self.account, \ - room_jid) + contact = gajim.contacts.get_contact_with_highest_priority( + self.account, room_jid) if contact: gajim.interface.roster.draw_contact(room_jid, self.account) if groupchat_control: -- GitLab