+2007-10-10 Martin Schanzenbach <mschanzenbach@gmail.com>
+
+ * shell/ev-window.c: (ev_window_refresh_window_thumbnail),
+ (ev_window_setup_document), (ev_window_rotation_changed_cb):
+
+ Rotate also the window icon when document is rotated. Fixes bug
+ #474681.
+
2007-10-04 Carlos Garcia Campos <carlosgc@gnome.org>
* backend/pdf/ev-poppler.cc: (ev_form_field_from_poppler_field),
ev_window_clear_thumbnail_job (ev_window);
}
+static void
+ev_window_refresh_window_thumbnail (EvWindow *ev_window, int rotation)
+{
+
+ EvRenderContext *rc;
+ gint page_width, page_height;
+ gdouble scale;
+ EvDocument *document = ev_window->priv->document;
+
+ if (!EV_IS_DOCUMENT_THUMBNAILS (document)) {
+ return;
+ }
+
+ ev_window_clear_thumbnail_job (ev_window);
+
+ ev_page_cache_get_size (ev_window->priv->page_cache,
+ 0, 0, 1.0,
+ &page_width, &page_height);
+ scale = (gdouble)128 / (gdouble)page_width;
+
+ rc = ev_render_context_new (rotation, 0, scale);
+
+ ev_window->priv->thumbnail_job = ev_job_thumbnail_new (document, rc);
+ g_signal_connect (ev_window->priv->thumbnail_job, "finished",
+ G_CALLBACK (ev_window_set_icon_from_thumbnail),
+ ev_window);
+ ev_job_queue_add_job (EV_JOB (ev_window->priv->thumbnail_job), EV_JOB_PRIORITY_LOW);
+ g_object_unref (rc);
+}
+
static gboolean
ev_window_setup_document (EvWindow *ev_window)
{
G_CALLBACK (find_changed_cb),
ev_window, 0);
}
-
- if (EV_IS_DOCUMENT_THUMBNAILS (document)) {
- EvRenderContext *rc;
- gint page_width, page_height;
- gdouble scale;
-
- ev_window_clear_thumbnail_job (ev_window);
-
- ev_page_cache_get_size (ev_window->priv->page_cache,
- 0, 0, 1.0,
- &page_width, &page_height);
- scale = (gdouble)128 / (gdouble)page_width;
-
- rc = ev_render_context_new (0, 0, scale);
- ev_window->priv->thumbnail_job = ev_job_thumbnail_new (document, rc);
- g_signal_connect (ev_window->priv->thumbnail_job, "finished",
- G_CALLBACK (ev_window_set_icon_from_thumbnail),
- ev_window);
- ev_job_queue_add_job (EV_JOB (ev_window->priv->thumbnail_job), EV_JOB_PRIORITY_LOW);
- g_object_unref (rc);
- }
+
+ ev_window_refresh_window_thumbnail (ev_window, 0);
ev_window_set_page_mode (ev_window, PAGE_MODE_DOCUMENT);
ev_window_title_set_document (ev_window->priv->title, document);
ev_sidebar_thumbnails_refresh (EV_SIDEBAR_THUMBNAILS (window->priv->sidebar_thumbs),
rotation);
+ ev_window_refresh_window_thumbnail (window, rotation);
}
static void