From: Jonathan Blandford Date: Sat, 4 Jun 2005 14:57:00 +0000 (+0000) Subject: other_page isn't necessarily page + 1. X-Git-Tag: EVINCE_0_3_3~288 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=1e52e37fcdfa46c0cc6e1ac9958cdde28ff7a629;p=evince.git other_page isn't necessarily page + 1. Fri Jun 3 21:07:57 2005 Jonathan Blandford * shell/ev-view.c (get_page_extents): other_page isn't necessarily page + 1. * shell/ev-window.c: Make sure we add the timeout when we get a focus-in event. * shell/ev-view.c (view_set_adjustment_values): Add 0.5 to adjustment->value before calculating the zoom factor to average out all of our rounding errors. The page no longer 'drifts' when resizing. --- diff --git a/ChangeLog b/ChangeLog index 665f6829..460cebcc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Fri Jun 3 21:07:57 2005 Jonathan Blandford + + * shell/ev-view.c (get_page_extents): other_page isn't necessarily + page + 1. + + * shell/ev-window.c: Make sure we add the timeout when we get a + focus-in event. + + * shell/ev-view.c (view_set_adjustment_values): Add 0.5 to + adjustment->value before calculating the zoom factor to average + out all of our rounding errors. The page no longer 'drifts' when + resizing. + 2005-06-04 Nickolay V. Shmyrev * data/evince-properties.glade: diff --git a/TODO b/TODO index 576f2abc..9245e735 100644 --- a/TODO +++ b/TODO @@ -1,10 +1,11 @@ Hook up recent documents support (though rumors are that it's slow) +Fix shadow to be a real shadow -- not the thick bars they are now. + Improve Find system Display location of results in thumbnails? Only display thumbnails of pages found? -Sidebar improvements for ps/pixbuf, or PDF files without a TOC. bug 164811 Improve Printing Support: (libgnomeprintui?) @@ -37,3 +38,4 @@ Move to having three sizing types: * Free zooming * constrain to width * constrain to height +Sidebar improvements for ps/pixbuf, or PDF files without a TOC. bug 164811 diff --git a/shell/ev-view.c b/shell/ev-view.c index 5b81ce38..20c0eefd 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -422,14 +422,16 @@ view_set_adjustment_values (EvView *view, return; factor = 1.0; + /* We add 0.5 to the values before to average out our rounding errors. + */ switch (view->pending_scroll) { case SCROLL_TO_KEEP_POSITION: - factor = adjustment->value / adjustment->upper; + factor = (adjustment->value + 0.5) / adjustment->upper; break; case SCROLL_TO_CURRENT_PAGE: break; case SCROLL_TO_CENTER: - factor = (adjustment->value + adjustment->page_size * 0.5) / adjustment->upper; + factor = (adjustment->value + adjustment->page_size * 0.5 + 0.5) / adjustment->upper; break; } @@ -806,7 +808,7 @@ get_page_extents (EvView *view, /* First, we get the bounding box of the two pages */ if (other_page < ev_page_cache_get_n_pages (view->page_cache)) { ev_page_cache_get_size (view->page_cache, - page + 1, + other_page, view->scale, &width_2, &height_2); if (width_2 > width) diff --git a/shell/ev-window.c b/shell/ev-window.c index 2ebcc1b3..034fa1b0 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -172,7 +172,8 @@ static void ev_window_run_presentation (EvWindow *windo static void ev_window_stop_presentation (EvWindow *window); static void ev_window_cmd_view_presentation (GtkAction *action, EvWindow *window); - +static void show_fullscreen_popup (EvWindow *window); + G_DEFINE_TYPE (EvWindow, ev_window, GTK_TYPE_WINDOW) @@ -316,7 +317,10 @@ update_chrome_visibility (EvWindow *window) set_widget_visibility (priv->fullscreen_toolbar, fullscreen_toolbar); if (priv->fullscreen_popup != NULL) { - set_widget_visibility (priv->fullscreen_popup, fullscreen); + if (fullscreen) + show_fullscreen_popup (window); + else + set_widget_visibility (priv->fullscreen_popup, FALSE); } } @@ -1388,6 +1392,18 @@ fullscreen_clear_timeout (EvWindow *window) ev_view_show_cursor (EV_VIEW (window->priv->view)); } + +static void +show_fullscreen_popup (EvWindow *window) +{ + if (!GTK_WIDGET_VISIBLE (window->priv->fullscreen_popup)) { + g_object_set (window->priv->fullscreen_popup, "visible", TRUE, NULL); + ev_view_show_cursor (EV_VIEW (window->priv->view)); + } + + fullscreen_set_timeout (window); +} + static gboolean fullscreen_motion_notify_cb (GtkWidget *widget, GdkEventMotion *event, @@ -1395,12 +1411,7 @@ fullscreen_motion_notify_cb (GtkWidget *widget, { EvWindow *window = EV_WINDOW (user_data); - if (!GTK_WIDGET_VISIBLE (window->priv->fullscreen_popup)) { - g_object_set (window->priv->fullscreen_popup, "visible", TRUE, NULL); - ev_view_show_cursor (EV_VIEW (window->priv->view)); - } - - fullscreen_set_timeout (window); + show_fullscreen_popup (window); return FALSE; } @@ -1645,7 +1656,7 @@ ev_window_focus_in_event (GtkWidget *widget, GdkEventFocus *event) NULL); if (fullscreen) - gtk_widget_show (priv->fullscreen_popup); + show_fullscreen_popup (window); return GTK_WIDGET_CLASS (ev_window_parent_class)->focus_in_event (widget, event); } @@ -2327,6 +2338,10 @@ ev_window_dispose (GObject *object) priv->find_bar = NULL; } + if (window->priv->fullscreen_timeout_source) { + g_source_destroy (window->priv->fullscreen_timeout_source); + window->priv->fullscreen_timeout_source = NULL; + } destroy_fullscreen_popup (window); G_OBJECT_CLASS (ev_window_parent_class)->dispose (object);