[polari] chatView: Animate auto-scrolling to bottom
- From: Florian MĂźllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] chatView: Animate auto-scrolling to bottom
- Date: Tue, 22 Dec 2015 13:45:11 +0000 (UTC)
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]