From: Jonathan Blandford Date: Fri, 20 May 2005 05:29:43 +0000 (+0000) Subject: Patch from Nickolay Shmyrev to to scroll to second page on page_changed if X-Git-Tag: EVINCE_0_3_1~7 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=fba0ac29870eb3907c86a48733ba30d158f1b119;p=evince.git Patch from Nickolay Shmyrev to to scroll to second page on page_changed if Fri May 20 01:27:01 2005 Jonathan Blandford * shell/ev-view.c: Patch from Nickolay Shmyrev to to scroll to second page on page_changed if possible, #304669 --- diff --git a/ChangeLog b/ChangeLog index ac328e3b..358d6487 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri May 20 01:27:01 2005 Jonathan Blandford + + * shell/ev-view.c: Patch from Nickolay Shmyrev to to scroll to + second page on page_changed if possible, #304669 + Fri May 20 01:07:15 2005 Jonathan Blandford * shell/ev-view.c (view_update_adjustments): Use gdk_window_scroll diff --git a/shell/ev-view.c b/shell/ev-view.c index 3da8d138..04dfd73f 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -537,7 +537,7 @@ view_scroll_to_page (EvView *view, gint new_page) EvPageCache *page_cache = view->page_cache; int old_width, old_height; int new_width, new_height; - int max_height, n_rows; + int max_height, max_width, n_rows; ev_page_cache_get_size (page_cache, view->current_page, @@ -556,11 +556,11 @@ view_scroll_to_page (EvView *view, gint new_page) else gtk_widget_queue_draw (GTK_WIDGET (view)); - if (view->continuous) { + get_bounding_box_size (view, &max_width, &max_height); + + if (view->continuous && view->vadjustment) { n_rows = view->dual_page ? new_page / 2 : new_page; - - get_bounding_box_size (view, NULL, &max_height); gtk_adjustment_clamp_page(view->vadjustment, (max_height + view->spacing) * n_rows, @@ -570,6 +570,20 @@ view_scroll_to_page (EvView *view, gint new_page) 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); + } 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); + } + } view->current_page = new_page; view_update_range_and_current_page (view);