GNOME Bugzilla – Bug 664414
Should scroll down one page on <space>
Last modified: 2012-02-29 21:16:51 UTC
Evince scrolls down one (screen) page when one hits <space>, it'd be great if gnome-documents would do the same.
Created attachment 208715 [details] [review] A patch to scroll down the documents page by hitting space bar.
Review of attachment 208715 [details] [review]: ::: src/preview.js @@ +51,3 @@ + let keyval = event.get_keyval()[1]; + + if (keyval == 32) { Why using the numeric value here?Just import Gdk and use Gdk.KEY_space instead. Also, since the if block is a single-line statement, our coding style doesn't use brackets around it. @@ +52,3 @@ + + if (keyval == 32) { + this.widget.scroll(Gtk.ScrollType.PAGE_FORWARD, Gtk.ScrollType.NONE); The second parameter to this call is wrong; the signature of ev_view_scroll is void ev_view_scroll (EvView *view, GtkScrollType scroll, gboolean horizontal) so the argument should be false instead of Gtk.ScrollType.NONE.
Created attachment 208720 [details] [review] A patch to scroll down the documents page by hitting space bar.
Created attachment 208721 [details] [review] A patch to scroll down the documents page by hitting space bar.
Thanks! I pushed a slightly modified version of this patch to git master (we're supposed to return true/false from key-press-event handlers to stop/continue propagation of the event up in the hierarchy).