]> www.fi.muni.cz Git - evince.git/commitdiff
Horizontal scroll on selection also.
authorNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Tue, 27 Dec 2005 07:56:18 +0000 (07:56 +0000)
committerNickolay V. Shmyrev <nshmyrev@src.gnome.org>
Tue, 27 Dec 2005 07:56:18 +0000 (07:56 +0000)
* shell/ev-view.c: (selection_scroll_timeout_cb):

Horizontal scroll on selection also.

ChangeLog
shell/ev-view.c

index 229cc1db25dfd0bd259085646d906f10528cb00b..a1d1ed274d1435472ce6213834a47219fc96689b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-12-27  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
+
+       * shell/ev-view.c: (selection_scroll_timeout_cb):
+       
+       Horizontal scroll on selection also.
+
 2005-12-26  Nickolay V. Shmyrev  <nshmyrev@yandex.ru>
 
        * shell/ev-metadata-manager.c: (parse_value):
index 1f089fcf3ed41a95ddcdcbfb9de9352cfb887235..285d52bd39963bb3aa90e3fd3af26345ae25976b 100644 (file)
@@ -1706,10 +1706,10 @@ selection_update_idle_cb (EvView *view)
 static gboolean
 selection_scroll_timeout_cb (EvView *view)
 {      
-       gint y, shift = 0;
+       gint x, y, shift = 0;
        GtkWidget *widget = GTK_WIDGET (view);
        
-       gtk_widget_get_pointer (widget, NULL, &y);
+       gtk_widget_get_pointer (widget, &x, &y);
 
        if (y > widget->allocation.height) {
                shift = (y - widget->allocation.height) / 2;
@@ -1723,6 +1723,20 @@ selection_scroll_timeout_cb (EvView *view)
                                          view->vadjustment->lower,
                                          view->vadjustment->upper -
                                          view->vadjustment->page_size));       
+
+       if (x > widget->allocation.width) {
+               shift = (x - widget->allocation.width) / 2;
+       } else if (x < 0) {
+               shift = x / 2;
+       }
+
+       if (shift)
+               gtk_adjustment_set_value (view->hadjustment,
+                                         CLAMP (view->hadjustment->value + shift,
+                                         view->hadjustment->lower,
+                                         view->hadjustment->upper -
+                                         view->hadjustment->page_size));       
+
        return TRUE;
 }