[polari] chatView: Animate auto-scrolling to bottom



commit 65f9c8a077fe31e5e3e4420e8a0cfdc11e8bf17f
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Dec 22 13:35:14 2015 +0100

    chatView: Animate auto-scrolling to bottom
    
    Unless the user is reading the backlog or there are unread highlights,
    we jump to the bottom of the view on arrival of new messages. While
    the jump is usually a single line, animations generally give transitions
    a more natural feel, so move the cursor instead which allows GTK+ to
    animate the transition.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=759772

 src/chatView.js |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index e7e52d8..77168f7 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -432,7 +432,8 @@ const ChatView = new Lang.Class({
         let adj = this.widget.vadjustment;
         if (adj.value == this._scrollBottom) {
             if (this._nPending == 0) {
-                adj.value = adj.upper - adj.page_size;
+                this._view.emit('move-cursor',
+                                Gtk.MovementStep.BUFFER_ENDS, 1, false);
             } else {
                 let id = Object.keys(this._pending).sort(function(a, b) {
                     return a - b;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]