]> www.fi.muni.cz Git - evince.git/commitdiff
Patch from Nickolay V. Shmyrev to reset the adjustment when the mode
authorJonathan Blandford <jrb@redhat.com>
Sat, 21 May 2005 02:10:42 +0000 (02:10 +0000)
committerJonathan Blandford <jrb@src.gnome.org>
Sat, 21 May 2005 02:10:42 +0000 (02:10 +0000)
Fri May 20 22:05:25 2005  Jonathan Blandford  <jrb@redhat.com>

        * *shell/ev-view.c: Patch from Nickolay V. Shmyrev to reset the
        adjustment when the mode changes, #304923

ChangeLog
shell/ev-view.c

index fe688aea62ffd126c04cc6359c73f67df732eb70..15b0a3eb76eb6168b1543825ef00b6ffe2caa0d4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri May 20 22:05:25 2005  Jonathan Blandford  <jrb@redhat.com>
+
+       * *shell/ev-view.c: Patch from Nickolay V. Shmyrev to reset the
+       adjustment when the mode changes, #304923
+
 Fri May 20 02:00:03 2005  Nickolay V. Shmyrev <nshmyrev@yandex.ru>
 
        * shell/ev-view.c: Use gdk_widget_queue_draw to remove
index d9dddaf24e61c304635f5d9f6f4af6c34cf571a1..b8723ccc8bc0a721500514d1191c8ae9650b10d8 100644 (file)
@@ -114,8 +114,8 @@ struct _EvView {
        char *status;
        char *find_status;
 
-       int scroll_x;
-       int scroll_y;
+       gint scroll_x;
+       gint scroll_y;
 
        DragInfo drag_info;
        gboolean pressed_button;
@@ -562,30 +562,40 @@ view_scroll_to_page (EvView *view, gint new_page)
        
        get_bounding_box_size (view, &max_width, &max_height);
        
-       if (view->continuous && view->vadjustment) {
+       if (view->vadjustment) {
+               if (view->continuous) {
                
-               n_rows = view->dual_page ? new_page / 2 : new_page;
+                       n_rows = view->dual_page ? new_page / 2 : new_page;
 
-               gtk_adjustment_clamp_page(view->vadjustment,
-                                         (max_height + view->spacing) * n_rows, 
-                                         (max_height + view->spacing) * n_rows +
-                                          view->vadjustment->page_size);
-       } else {
-               gtk_adjustment_set_value (view->vadjustment,
-                                         view->vadjustment->lower);
+                       gtk_adjustment_clamp_page(view->vadjustment,
+                                                 (max_height + view->spacing) * n_rows, 
+                                                 (max_height + view->spacing) * n_rows +
+                                                  view->vadjustment->page_size);
+               } else {
+                       gtk_adjustment_set_value (view->vadjustment,
+                                                 view->vadjustment->lower);
+               }
        }
        
-       if (view->dual_page && view->hadjustment) {
-               if (new_page % 2 == 0) {
-                       gtk_adjustment_set_value (view->hadjustment,
-                                                 view->hadjustment->lower);
+       if (view->hadjustment) {
+               if (view->dual_page) {
+                       if (new_page % 2 == 0) {
+                               gtk_adjustment_set_value (view->hadjustment,
+                                                         view->hadjustment->lower);
+                       } else {
+                               gtk_adjustment_clamp_page (view->hadjustment,
+                                                          view->hadjustment->lower + 
+                                                          max_width + view->spacing, 
+                                                          view->hadjustment->lower +
+                                                          max_width + view->spacing +
+                                                          view->hadjustment->page_size);
+                       }
                } else {
-                       gtk_adjustment_clamp_page (view->hadjustment,
-                                                  view->hadjustment->lower + 
-                                                  max_width + view->spacing, 
-                                                  view->hadjustment->lower +
-                                                  max_width + view->spacing +
-                                                  view->hadjustment->page_size);
+                               gtk_adjustment_set_value (view->hadjustment,
+                                                         CLAMP (view->hadjustment->value, 
+                                                         view->hadjustment->lower,
+                                                         view->hadjustment->upper - 
+                                                         view->hadjustment->page_size));
                }
        }