GNOME Bugzilla – Bug 165120
wishlist-spacebar scrolling
Last modified: 2005-04-03 00:08:03 UTC
A longstanding UNIX tradition is the ability to step through a document using only the space bar, as in: 1) open doc 2) click space bar until the end evince should be able to scroll down a page and between pages using only the space bar.
xpdf does this pretty well, so i suppose backspace should do the same in the other direction. a related confusing fact: the icon for "down" is an upward pointing arrow and vice versa. propose to change labels to previous and next.
Longstanding UNIX traditions aren't reasons for including features in modern systems. ;-) However this seems fairly harmless. I believe this will be blocking on bug 165469 as well.
Created attachment 37880 [details] [review] Allow the space bar to be used to scroll down the page
Created attachment 37881 [details] [review] Allow the backspace and space bar to be used to scroll up and down the page
Comment on attachment 37881 [details] [review] Allow the backspace and space bar to be used to scroll up and down the page Code looks good. I'll delegate approval to Bryan because of the Backspace bit.
I attached both patches just in case Bryan wanted to include or not include the backspace portion. Since both these keymap events exist in xpdf, I thought evince might want to support both.
The space bar doesn't actually scroll the page in this patch. It seems to only jump to the next page. I thought the intention was to give the old UNIX flavor of scrolling down to the end of the document and then switching pages when you run to the end of the page.
Oh! /me is not expert enough about old UNIX flavors ;)
This time I've come up with a revision that allows the user to step through a document using the spacebar and backspace keys. Please take a look at it and tell me what, if anything, needs to be changed.
Created attachment 38011 [details] [review] Revision 2: browse document using spacebar and backspace
Wow, awesome work Emil! This looks great to me, how about you marco?
Comment on attachment 38011 [details] [review] Revision 2: browse document using spacebar and backspace +enum { + GTK_SCROLL_JUMP_FORWARD, + GTK_SCROLL_JUMP_BACKWARD +}; I dont think we should "extend" a gtk enum like this, using their own namespace. I'd rather use our own enum at this point. So EV_SCROLL_PAGE_FORWARD etc... + GtkAdjustment *adjustment; + GtkWidget *widget = GTK_WIDGET (view); Please factor out this part of the code to a separate static function (ev_view_scroll_jump?) + GtkAdjustment *adjustment; + GtkWidget *widget = GTK_WIDGET (view); + + double value; + double increment; Do not separate var declarations with new lines. + ; Please remove this here and below. && ev_view_get_page (view) == ev_document_get_n_pages (view->document) Please assign this to a last_page boolean
Bryan is an increment of 0.5 * current height of the view widget the increment we want?
Hmm, seems to work ok for me. But I'm sure it's one of those things we won't know what the best value is without some good testing.
Marco and Bryan, I played around with the multiplier setting and assigned it (at various times) values of 0.3, 0.33, 0.5, 0.7, and 0.8. The lower values, 0.3 and 0.33, were too small as the number of times I had to hit the spacebar was around 6 or 7. The higher values, 0.7 and 0.8, were too large as it only took 2 spacebar hits to reach the end of the page. While the 0.5 multiplier takes 3 to 4 hits of the spacebar to reach the end. This is my unscientific observation of this so take it with a grain of salt. :) The third revision of the patch will follow shortly.
Hey all, I don't understand what you are doing with this multiplier. The way spacebar traditionally works is one tap on the bar moves you down to the next area of text, possibly with a small, one or two line, overlap. The scrolling distance is *not* arbitrary. The overlap and its size change from program to program but the basic idea is that you are moving down a 'screen page' at a time. For an example, try, in a terminal, man man or info info and play with the spacebar. Man has no overlap, info has a two line overlap. With pdf docs it seems the tradition is, at the bottom of the page, to move the visible area only far enough to include the rest of the page so the reader has to move her eye down and find the continuation of the text. This is a minor annoyance compensated by having a nice layout of the page on the screen. (The opposite approach would have large gaps of 'background' below the page. hope that helps, --adrian
For your info, I see that xpdf simply moves the screen down to the point immediately below the previous bottom of the screen. This has the unfortunate consequence of possibly cutting a single line into two unreadable halfs destroying the gain in time that the spacebar provides. gpdf follows xpdf. gv has an annoying random distance it scrolls down. Makes every tap of the bar demand of the user that they find their place. ggv is broken on my system. acroread uses the pgdown key not the space bar, and adds a bit of overlap, about the size of the textwidth at 100% zoom, although this is probably system dependent. Of these, acroread is the most readable. Goes to show that effort at making things "just kick a**" makes for a good product. :-) all the best, adrian
I second this bug (I would switch to evince, but I can't effectively navigate documents in it). However, may I make the further suggestion that Shift-Space perform the same backward-scrolling as backspace. This is done by at least gv and firefox. While it's not generally a UNIX tradition like space-scrolling, it makes sense from a usability standpoint.
What's up with this ? Bryan, Emil what do you think about Adrian comment?
I'm sorry but I haven't had a chance to look at the code for the past week. I've read Adrian's comment about the overlapping of text between scrolls and he makes quite a bit of sense. I will try to get that incorporated into the current patch. Marco, I've been looking at ways to factor out the top portion of the code in ev_view_scroll_view but I don't see what can. Can you give me a hint?
Maybe I've been unclear... I was thinking to something like static void ev_view_jump (EvView *view, EvScrollType scroll) Basically all the code you added would go there. Make sense?
Yes, the goal is something like what acroread does. Have a small amount of overlap, like a single paragraph height. I thought that's what this is doing now since it does always leave the overlap available, however it's just taking 1/2 the height of the window so you do have to find your place again. I guess we want something like moving .75 of the window height to leave a small amount of overlap. Doing it by number of text lines visible would be the ideal, but not necessary. If we choose some small amount of height that we always overlap it should work as intended.
Emil, if you have issues finishing this patch you could try to join irc.gnome.org #evince in week days. I can help out...
Hi Marco, I apologize for being tardy this past week but work related issues came up. However, this weekend presents me with a good opportunity to implement Adrian's and Bryan's suggestions. I also will try to get on irc too to chat with everybody.
Emil, dont worry, I was just concerned you was still blocked by not having fully understood my comments on the patch...
Created attachment 38917 [details] [review] Revision 3: browse document using spacebar and backspace
I hope this patch can avoid the annoying case where at (almost) the end of the page you need to hit space twice to get to the next page: once to scroll only one or two rows (or pixels at worst) and second hit is required to actually switch pages even though the original position was already practically as good as the end of the page. At least if you use (back)space exclusively for scrolling that should be avoidable by extending the scroll height appropriately.
Created attachment 38919 [details] [review] Revision 4: browse document using spacebar and backspace
Tommi, This patch does not avoid the case which you describe and it would be pretty difficult to fix at the current time. We will definitely keep an eye on this in the near future.
Created attachment 38922 [details] [review] Final Revision: browse document using spacebar and backspace
Suggestion: Remember that some people (me) will use evince for doing presentations in fullscreen mode, so the space bar should go to the next page when in that mode. Thanks.
comment 27 : I'd like that too, however I don't want that requirement to halt this patch going through. Ideally we could work out a system that figures out margins and viewable text areas to decide if you should go to the next page or not. Bug 169676 is a similar problem to this. comment 31 : This is pretty much the same problem. Assuming your presenation takes up the fullscreen spacebar should take you to the next page. Otherwise you'll have to use page down until this is fixed. *shrug* It's up to the maintainers really, but before we block this patch completely I'd like to see it go in and then deal with separate bugs about the behavior improvements. Since I think all these behavior complaints are related to bug 169676 I don't see a need for us to block this fix waiting for the root of the problem to be fixed.
Committed. Thanks!