diff options
Diffstat (limited to 'shell/ev-sidebar-thumbnails.c')
-rw-r--r-- | shell/ev-sidebar-thumbnails.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c index ec03d998..5fb951ac 100644 --- a/shell/ev-sidebar-thumbnails.c +++ b/shell/ev-sidebar-thumbnails.c @@ -68,7 +68,6 @@ struct _EvSidebarThumbnailsPrivate { EvDocument *document; EvDocumentModel *model; EvThumbsSizeCache *size_cache; - gint n_pages, pages_done; int rotation; @@ -136,8 +135,14 @@ ev_thumbnails_size_cache_new (EvDocument *document) page = ev_document_get_page (document, i); - ev_document_get_page_size (document, i, &page_width, &page_height); - + if (document->iswebdocument == FALSE ) { + ev_document_get_page_size (document, i, &page_width, &page_height); + } + else { + /* Hardcoding these values to a large enough dimesnsion so as to achieve max content without loss in visibility*/ + page_width = 800; + page_height = 1080; + } if (!rc) { rc = ev_render_context_new (page, 0, (gdouble)THUMBNAIL_WIDTH / page_width); } else { @@ -368,6 +373,7 @@ clear_range (EvSidebarThumbnails *sidebar_thumbnails, result && start_page <= end_page; result = gtk_tree_model_iter_next (GTK_TREE_MODEL (priv->list_store), &iter), start_page ++) { EvJobThumbnail *job; + GdkPixbuf *loading_icon = NULL; gint width, height; @@ -409,9 +415,12 @@ get_scale_for_page (EvSidebarThumbnails *sidebar_thumbnails, { EvSidebarThumbnailsPrivate *priv = sidebar_thumbnails->priv; gdouble width; - - ev_document_get_page_size (priv->document, page, &width, NULL); - + if (priv->document->iswebdocument == TRUE ) { + /* Hardcoded for epub documents*/ + width = 800; + } else { + ev_document_get_page_size (priv->document, page, &width, NULL); + } return (gdouble)THUMBNAIL_WIDTH / width; } @@ -444,6 +453,11 @@ add_range (EvSidebarThumbnails *sidebar_thumbnails, job = ev_job_thumbnail_new (priv->document, page, priv->rotation, get_scale_for_page (sidebar_thumbnails, page)); + + if (priv->document->iswebdocument) { + ev_job_set_run_mode(job, EV_JOB_RUN_MAIN_LOOP); + } + ev_job_scheduler_push_job (EV_JOB (job), EV_JOB_PRIORITY_HIGH); g_object_set_data_full (G_OBJECT (job), "tree_iter", @@ -856,7 +870,7 @@ thumbnail_job_completed_callback (EvJobThumbnail *job, GtkTreeIter *iter; iter = (GtkTreeIter *) g_object_get_data (G_OBJECT (job), "tree_iter"); - if (priv->inverted_colors) + if (priv->inverted_colors && priv->document->iswebdocument == FALSE) ev_document_misc_invert_pixbuf (job->thumbnail); gtk_list_store_set (priv->list_store, iter, |