[polari] chatView: Add shortcuts to jump to top/bottom
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] chatView: Add shortcuts to jump to top/bottom
- Date: Fri, 3 Jun 2016 13:54:47 +0000 (UTC)
commit 3bb9e3cd54b1e2ec8e685707a1ac566a857733a3
Author: Danny Mølgaard <moelgaard dmp gmail com>
Date: Wed Jun 1 18:21:31 2016 +0200
chatView: Add shortcuts to jump to top/bottom
GtkTextView's built-in bindings, <ctrl>Home and <ctrl>End, don't work,
as they are used by the first-room/last-room application shortcuts. As
we hide the cursor and don't have horizontal scrolling in the chat log,
the built-in bindings for jumping to the beginning/end of the current
line aren't useful, so use them to move to the top/bottom of the
chatlog instead.
https://bugzilla.gnome.org/show_bug.cgi?id=755549
src/chatView.js | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index eb2196a..f9cc7b0 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -595,6 +595,21 @@ const ChatView = new Lang.Class({
_onKeyPress: function(w, event) {
let [, keyval] = event.get_keyval();
+
+ if (keyval === Gdk.KEY_Home ||
+ keyval === Gdk.KEY_KP_Home) {
+ this._view.emit('move-cursor',
+ Gtk.MovementStep.BUFFER_ENDS,
+ -1, false);
+ return Gdk.EVENT_STOP;
+ } else if (keyval === Gdk.KEY_End ||
+ keyval === Gdk.KEY_KP_End) {
+ this._view.emit('move-cursor',
+ Gtk.MovementStep.BUFFER_ENDS,
+ 1, false);
+ return Gdk.EVENT_STOP;
+ }
+
if (keyval != Gdk.KEY_Up &&
keyval != Gdk.KEY_KP_Up &&
keyval != Gdk.KEY_Page_Up &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]