After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 664414 - Should scroll down one page on <space>
Should scroll down one page on <space>
Status: RESOLVED FIXED
Product: gnome-documents
Classification: Core
Component: general
0.2.x
Other Linux
: Normal enhancement
: ---
Assigned To: GNOME documents maintainer(s)
GNOME documents maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2011-11-20 12:19 UTC by Guido Günther
Modified: 2012-02-29 21:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A patch to scroll down the documents page by hitting space bar. (1.48 KB, patch)
2012-02-29 20:01 UTC, Felipe Borges
needs-work Details | Review
A patch to scroll down the documents page by hitting space bar. (1.36 KB, patch)
2012-02-29 20:43 UTC, Felipe Borges
none Details | Review
A patch to scroll down the documents page by hitting space bar. (1.34 KB, patch)
2012-02-29 20:51 UTC, Felipe Borges
committed Details | Review

Description Guido Günther 2011-11-20 12:19:24 UTC
Evince scrolls down one (screen) page when one hits <space>, it'd be great if gnome-documents would do the same.
Comment 1 Felipe Borges 2012-02-29 20:01:58 UTC
Created attachment 208715 [details] [review]
A patch to scroll down the documents page by hitting space bar.
Comment 2 Cosimo Cecchi 2012-02-29 20:11:11 UTC
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.
Comment 3 Felipe Borges 2012-02-29 20:43:14 UTC
Created attachment 208720 [details] [review]
A patch to scroll down the documents page by hitting space bar.
Comment 4 Felipe Borges 2012-02-29 20:51:55 UTC
Created attachment 208721 [details] [review]
A patch to scroll down the documents page by hitting space bar.
Comment 5 Cosimo Cecchi 2012-02-29 21:16:48 UTC
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).