don't use smooth scrolling when chnging fond or resizing chr window. Fixes #7268

This commit is contained in:
Denis Fomin 2013-08-23 18:46:35 +04:00
parent 3e5c7b184d
commit e884cb20ab
1 changed files with 11 additions and 6 deletions

View File

@ -1277,14 +1277,20 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
# used to stay at the end of the textview when we shrink conversation # used to stay at the end of the textview when we shrink conversation
# textview. # textview.
if self.was_at_the_end: if self.was_at_the_end:
self.conv_textview.bring_scroll_to_end(-18, use_smooth=False) if self.conv_textview.at_the_end():
self.was_at_the_end = (adjustment.upper - adjustment.value - adjustment.page_size) < 18 # 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): def on_conversation_vadjustment_value_changed(self, adjustment):
# stop automatic scroll when we manually scroll # stop automatic scroll when we manually scroll
if not self.conv_textview.auto_scrolling: if not self.conv_textview.auto_scrolling:
self.conv_textview.stop_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: if self.resource:
jid = self.contact.get_full_jid() jid = self.contact.get_full_jid()
else: else:
@ -1328,9 +1334,8 @@ class ChatControlBase(MessageControl, ChatCommandProcessor, CommandTools):
if room_jid in gajim.interface.minimized_controls[self.account]: if room_jid in gajim.interface.minimized_controls[self.account]:
groupchat_control = \ groupchat_control = \
gajim.interface.minimized_controls[self.account][room_jid] gajim.interface.minimized_controls[self.account][room_jid]
contact = \ contact = gajim.contacts.get_contact_with_highest_priority(
gajim.contacts.get_contact_with_highest_priority(self.account, \ self.account, room_jid)
room_jid)
if contact: if contact:
gajim.interface.roster.draw_contact(room_jid, self.account) gajim.interface.roster.draw_contact(room_jid, self.account)
if groupchat_control: if groupchat_control: