diff options
author | Nickolay V. Shmyrev <nshmyrev@src.gnome.org> | 2006-01-06 10:02:13 (GMT) |
---|---|---|
committer | Nickolay V. Shmyrev <nshmyrev@src.gnome.org> | 2006-01-06 10:02:13 (GMT) |
commit | d8d90e4a79195019fc19882729b8fda0be5ba563 (patch) | |
tree | 929cf162e330b046349712251b829995daf0490c /shell/ev-view.c | |
parent | f32f94f33c3496db085dfee35382baba030eef27 (diff) |
Two page scrolling with Space and PageUp in dual mode. Second fix for the
* shell/ev-view.c: (ev_view_scroll), (ev_view_previous_page),
(ev_view_can_previous_page), (ev_view_can_next_page):
* shell/ev-view.h:
* shell/ev-window.c: (update_action_sensitivity):
Two page scrolling with Space and PageUp in dual mode. Second fix
for the bug #316608.
Diffstat (limited to 'shell/ev-view.c')
-rw-r--r-- | shell/ev-view.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/shell/ev-view.c b/shell/ev-view.c index ebbd784..d35d4fc 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -578,7 +578,7 @@ ev_view_scroll (EvView *view, /* At the top of a page, assign the upper bound limit of previous page */ } else if (value == (adjustment->lower)) { value = adjustment->upper - adjustment->page_size; - ev_page_cache_set_current_page (view->page_cache, view->current_page - 1); + ev_view_previous_page (view); /* Jump to the top */ } else { value = MAX (value - increment, adjustment->lower); @@ -591,7 +591,7 @@ ev_view_scroll (EvView *view, /* At the bottom of a page, assign the lower bound limit of next page */ } else if (value == (adjustment->upper - adjustment->page_size)) { value = 0; - ev_page_cache_set_current_page (view->page_cache, view->current_page + 1); + ev_view_next_page (view); /* Jump to the bottom */ } else { value = MIN (value + increment, adjustment->upper - adjustment->page_size); @@ -3961,6 +3961,31 @@ ev_view_previous_page (EvView *view) } } +gboolean +ev_view_can_previous_page (EvView *view) +{ + int page; + + g_return_val_if_fail (EV_IS_VIEW (view), FALSE); + + page = ev_page_cache_get_current_page (view->page_cache); + page = ev_view_get_dual_page (view) ? page - 2 : page - 1; + + return (page >=0); +} + +gboolean ev_view_can_next_page (EvView *view) +{ + int page; + + g_return_val_if_fail (EV_IS_VIEW (view), FALSE); + + page = ev_page_cache_get_current_page (view->page_cache); + page = ev_view_get_dual_page (view) ? page + 2 : page + 1; + + return (page < ev_page_cache_get_n_pages (view->page_cache)); +} + /*** Enum description for usage in signal ***/ GType |