primitivus (chat): only scroll down if we are at the bottom of the discussion

This commit is contained in:
Goffi 2017-07-14 08:32:49 +02:00
commit 252e0e29f4

View file

@ -449,7 +449,10 @@ class Chat(PrimitivusWidget, quick_chat.QuickChat):
else:
wid = MessageWidget(message)
self.mess_walker.append(wid)
self.mess_widgets.focus_position = len(self.mess_walker) - 1 # scroll down
current_focus = self.mess_widgets.focus_position
bottom = len(self.mess_walker) - 1
if current_focus == bottom - 1:
self.mess_widgets.focus_position = bottom # scroll down
self.host.redraw() # FIXME: should not be necessary
if self._user_moved(message):
return # no notification for moved messages