]> www.fi.muni.cz Git - evince.git/commitdiff
other_page isn't necessarily page + 1.
authorJonathan Blandford <jrb@redhat.com>
Sat, 4 Jun 2005 14:57:00 +0000 (14:57 +0000)
committerJonathan Blandford <jrb@src.gnome.org>
Sat, 4 Jun 2005 14:57:00 +0000 (14:57 +0000)
Fri Jun  3 21:07:57 2005  Jonathan Blandford  <jrb@redhat.com>

        * 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.

ChangeLog
TODO
shell/ev-view.c
shell/ev-window.c

index 665f6829d75916f49e6b9cd324cdce0dc39011a1..460cebcc347b00ff137a5d99ddcae0e23618452d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+Fri Jun  3 21:07:57 2005  Jonathan Blandford  <jrb@redhat.com>
+
+       * 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  <nshmyrev@yandex.ru>
 
        * data/evince-properties.glade:
diff --git a/TODO b/TODO
index 576f2abc52e377aacc16070bb3c9f1e6c2654495..9245e735d02f26f486c196de00ef34ed6ca0c893 100644 (file)
--- 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
index 5b81ce3812de72a809c0cc59f881afc0492068f4..20c0eefd5b30cc525e91b053c3174c9e0dedbd40 100644 (file)
@@ -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)
index 2ebcc1b3572ad4292677664606077f7f1ebbade4..034fa1b06b54b6dbf76ddff5bd93d852873fd87c 100644 (file)
@@ -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);