]> www.fi.muni.cz Git - evince.git/commitdiff
Make PgUp/Down behave like Space
authorMarco Pesenti Gritti <mpg@redhat.com>
Wed, 18 May 2005 18:15:23 +0000 (18:15 +0000)
committerMarco Pesenti Gritti <marco@src.gnome.org>
Wed, 18 May 2005 18:15:23 +0000 (18:15 +0000)
2005-05-18  Marco Pesenti Gritti <mpg@redhat.com>

        * data/evince-ui.xml:
        * shell/ev-view.c: (ev_view_scroll_view), (ev_view_class_init):
        * shell/ev-window.c: (set_view_actions_sensitivity):

        Make PgUp/Down behave like Space

ChangeLog
data/evince-ui.xml
shell/ev-view.c
shell/ev-window.c

index 6df464b65a4d37f6b0bd1b29b218349b9755c6f2..6c597088a740ea811b87e10e1f5112082c1af7e5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-05-18  Marco Pesenti Gritti <mpg@redhat.com>
+
+       * data/evince-ui.xml:
+       * shell/ev-view.c: (ev_view_scroll_view), (ev_view_class_init):
+       * shell/ev-window.c: (set_view_actions_sensitivity):
+
+       Make PgUp/Down behave like Space
+
 2005-05-18  Marco Pesenti Gritti <mpg@redhat.com>
 
        * backend/ev-ps-exporter.c: (ev_ps_exporter_begin):
index c049cc080ce9f8e8fbf8e170d9e163f40a0b02ee..b3723fff9b39a630a8a3c845651ed54303b01ed7 100644 (file)
@@ -62,6 +62,8 @@
     <toolitem action="ViewZoom"/>
   </toolbar>
 
+  <accelerator name="PageDownAccel" action="PageDown"/>
+  <accelerator name="PageUpAccel" action="PageUp"/>
   <accelerator name="EscapeAccel" action="Escape"/>
   <accelerator name="SlashAccel" action="Slash"/>
   <accelerator name="SpaceAccel" action="Space"/>
index 3e28b0c58f690e9db8088f51f00b27c4e7d77d85..552b771c1d789a1c10ba3aa0375309c266d23905 100644 (file)
@@ -667,38 +667,32 @@ ev_view_scroll_view (EvView *view,
                     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
@@ -1824,9 +1818,6 @@ ev_view_class_init (EvViewClass *class)
        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
index 102e56c39c6212d25e3dbfca7f429df704991599..6549d3fd7996a2ad0a45dd78f3884d0549369722 100644 (file)
@@ -2325,10 +2325,10 @@ static const GtkActionEntry entries[] = {
           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",
@@ -2358,6 +2358,12 @@ static const GtkActionEntry entries[] = {
         { "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) },
@@ -2605,6 +2611,8 @@ static void
 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);