]> www.fi.muni.cz Git - evince.git/commitdiff
Add keybindings for percision-scrolling of display area. Fix for the bug
authorRicardo Markiewicz <rmarkie@fi.uba.ar>
Mon, 23 Jan 2006 23:39:58 +0000 (23:39 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Mon, 23 Jan 2006 23:39:58 +0000 (23:39 +0000)
2006-01-24  Ricardo Markiewicz  <rmarkie@fi.uba.ar>

* shell/ev-view.c: (add_scroll_binding_keypad),
(ev_view_binding_activated), (ev_view_class_init):

Add keybindings for percision-scrolling of display area.
Fix for the bug #314072.

ChangeLog
shell/ev-view.c

index 3d0864e15f93af709b1d582dcc13fabcc7f95843..0020ea309815f952ed7f564ebe788176bc5f707a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2006-01-24  Ricardo Markiewicz  <rmarkie@fi.uba.ar>
+
+       * shell/ev-view.c: (add_scroll_binding_keypad),
+       (ev_view_binding_activated), (ev_view_class_init):
+       
+       Add keybindings for percision-scrolling of display area. 
+       Fix for the bug #314072.
+
+2006-01-24  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
+
+       * shell/ev-view.c: (add_scroll_binding_keypad),
+       (ev_view_binding_activated), (ev_view_class_init):
+
 2006-01-21  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
        * data/evince.desktop.in.in:
index 311504b147e4116a9e6b844ad92bfbbe709d11d6..bf441533ff45c2df43ebd075fa58d9779b266404 100644 (file)
@@ -113,6 +113,7 @@ static void       ev_view_set_scroll_adjustments             (EvView
                                                              GtkAdjustment      *vadjustment);
 static void       add_scroll_binding_keypad                  (GtkBindingSet      *binding_set,
                                                              guint               keyval,
+                                                             GdkModifierType modifiers,
                                                              GtkScrollType       scroll,
                                                              gboolean            horizontal);
 static void       ev_view_binding_activated                  (EvView             *view,
@@ -541,16 +542,17 @@ ev_view_set_scroll_adjustments (EvView *view,
 static void
 add_scroll_binding_keypad (GtkBindingSet  *binding_set,
                           guint           keyval,
+                          GdkModifierType modifiers,
                           GtkScrollType   scroll,
                           gboolean        horizontal)
 {
   guint keypad_keyval = keyval - GDK_Left + GDK_KP_Left;
 
-  gtk_binding_entry_add_signal (binding_set, keyval, 0,
+  gtk_binding_entry_add_signal (binding_set, keyval, modifiers,
                                 "binding_activated", 2,
                                 GTK_TYPE_SCROLL_TYPE, scroll,
                                G_TYPE_BOOLEAN, horizontal);
-  gtk_binding_entry_add_signal (binding_set, keypad_keyval, 0,
+  gtk_binding_entry_add_signal (binding_set, keypad_keyval, modifiers,
                                 "binding_activated", 2,
                                 GTK_TYPE_SCROLL_TYPE, scroll,
                                G_TYPE_BOOLEAN, horizontal);
@@ -647,6 +649,12 @@ ev_view_binding_activated (EvView *view,
                case GTK_SCROLL_STEP_FORWARD:
                        value += adjustment->step_increment;
                        break;
+               case GTK_SCROLL_STEP_DOWN:
+                       value -= adjustment->step_increment/10;
+                       break;
+               case GTK_SCROLL_STEP_UP:
+                       value += adjustment->step_increment/10;
+                       break;
                default:
                        break;
        }
@@ -2544,10 +2552,14 @@ ev_view_class_init (EvViewClass *class)
 
        binding_set = gtk_binding_set_by_class (class);
 
-       add_scroll_binding_keypad (binding_set, GDK_Left,  GTK_SCROLL_STEP_BACKWARD, TRUE);
-       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_Left,  0, GTK_SCROLL_STEP_BACKWARD, TRUE);
+       add_scroll_binding_keypad (binding_set, GDK_Right, 0, GTK_SCROLL_STEP_FORWARD,  TRUE);
+       add_scroll_binding_keypad (binding_set, GDK_Left,  GDK_MOD1_MASK, GTK_SCROLL_STEP_DOWN, TRUE);
+       add_scroll_binding_keypad (binding_set, GDK_Right, GDK_MOD1_MASK, GTK_SCROLL_STEP_UP,  TRUE);
+       add_scroll_binding_keypad (binding_set, GDK_Up,    0, GTK_SCROLL_STEP_BACKWARD, FALSE);
+       add_scroll_binding_keypad (binding_set, GDK_Down,  0, GTK_SCROLL_STEP_FORWARD,  FALSE);
+       add_scroll_binding_keypad (binding_set, GDK_Up,    GDK_MOD1_MASK, GTK_SCROLL_STEP_DOWN, FALSE);
+       add_scroll_binding_keypad (binding_set, GDK_Down,  GDK_MOD1_MASK, GTK_SCROLL_STEP_UP,  FALSE);
 }
 
 static void