GtkScrollType scroll,
gboolean horizontal)
{
- if (scroll == GTK_SCROLL_PAGE_BACKWARD) {
- ev_page_cache_prev_page (view->page_cache);
- } else if (scroll == GTK_SCROLL_PAGE_FORWARD) {
- ev_page_cache_next_page (view->page_cache);
- } else {
- GtkAdjustment *adjustment;
- double value;
+ GtkAdjustment *adjustment;
+ double value;
- if (horizontal) {
- adjustment = view->hadjustment;
- } else {
- adjustment = view->vadjustment;
- }
+ if (horizontal) {
+ adjustment = view->hadjustment;
+ } else {
+ adjustment = view->vadjustment;
+ }
- value = adjustment->value;
+ value = adjustment->value;
- switch (scroll) {
- case GTK_SCROLL_STEP_BACKWARD:
- value -= adjustment->step_increment;
- break;
- case GTK_SCROLL_STEP_FORWARD:
- value += adjustment->step_increment;
- break;
- default:
- break;
- }
+ switch (scroll) {
+ case GTK_SCROLL_STEP_BACKWARD:
+ value -= adjustment->step_increment;
+ break;
+ case GTK_SCROLL_STEP_FORWARD:
+ value += adjustment->step_increment;
+ break;
+ default:
+ break;
+ }
- value = CLAMP (value, adjustment->lower,
- adjustment->upper - adjustment->page_size);
+ value = CLAMP (value, adjustment->lower,
+ adjustment->upper - adjustment->page_size);
- gtk_adjustment_set_value (adjustment, value);
- }
+ gtk_adjustment_set_value (adjustment, value);
}
#define MARGIN 5
add_scroll_binding_keypad (binding_set, GDK_Right, GTK_SCROLL_STEP_FORWARD, TRUE);
add_scroll_binding_keypad (binding_set, GDK_Up, GTK_SCROLL_STEP_BACKWARD, FALSE);
add_scroll_binding_keypad (binding_set, GDK_Down, GTK_SCROLL_STEP_FORWARD, FALSE);
-
- add_scroll_binding_keypad (binding_set, GDK_Page_Up, GTK_SCROLL_PAGE_BACKWARD, FALSE);
- add_scroll_binding_keypad (binding_set, GDK_Page_Down, GTK_SCROLL_PAGE_FORWARD, FALSE);
}
static void
G_CALLBACK (ev_window_cmd_view_reload) },
/* Go menu */
- { "GoPreviousPage", GTK_STOCK_GO_BACK, N_("_Previous Page"), "Page_Up",
+ { "GoPreviousPage", GTK_STOCK_GO_BACK, N_("_Previous Page"), "<control>Page_Up",
N_("Go to the previous page"),
G_CALLBACK (ev_window_cmd_go_previous_page) },
- { "GoNextPage", GTK_STOCK_GO_FORWARD, N_("_Next Page"), "Page_Down",
+ { "GoNextPage", GTK_STOCK_GO_FORWARD, N_("_Next Page"), "<control>Page_Down",
N_("Go to the next page"),
G_CALLBACK (ev_window_cmd_go_next_page) },
{ "GoFirstPage", GTK_STOCK_GOTO_FIRST, N_("_First Page"), "<control>Home",
{ "Slash", GTK_STOCK_FIND, NULL, "slash",
N_("Find a word or phrase in the document"),
G_CALLBACK (ev_window_cmd_edit_find) },
+ { "PageDown", NULL, "", "Page_Down",
+ N_("Scroll one page forward"),
+ G_CALLBACK (ev_window_cmd_scroll_forward) },
+ { "PageUp", NULL, "", "Page_Up",
+ N_("Scroll one page backward"),
+ G_CALLBACK (ev_window_cmd_scroll_backward) },
{ "Space", NULL, "", "space",
N_("Scroll one page forward"),
G_CALLBACK (ev_window_cmd_scroll_forward) },
set_view_actions_sensitivity (EvWindow *window, gboolean sensitive)
{
if (window->priv->action_group) {
+ set_action_sensitive (window, "PageDown", sensitive);
+ set_action_sensitive (window, "PageUp", sensitive);
set_action_sensitive (window, "Space", sensitive);
set_action_sensitive (window, "ShiftSpace", sensitive);
set_action_sensitive (window, "BackSpace", sensitive);