Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/ev-sidebar-thumbnails.c
diff options
context:
space:
mode:
authorJonathan Blandford <jrb@redhat.com>2005-01-06 23:56:14 (GMT)
committer Jonathan Blandford <jrb@src.gnome.org>2005-01-06 23:56:14 (GMT)
commit2aadab6feb778de1be1a92f20ba60e44de571199 (patch)
treea5773d36548293d25e98053c8b04f8dc1df9932d /shell/ev-sidebar-thumbnails.c
parentb322dbd94ce1ef24aa1d40e18cc18d66c9c85ef0 (diff)
fill in the thumbnail with white. New interface to get the size of a page.
Thu Jan 6 18:48:11 2005 Jonathan Blandford <jrb@redhat.com> * backend/ev-document-misc.c (ev_document_misc_get_thumbnail_frame): fill in the thumbnail with white. * backend/ev-document-thumbnails.h: New interface to get the size of a page.
Diffstat (limited to 'shell/ev-sidebar-thumbnails.c')
-rw-r--r--shell/ev-sidebar-thumbnails.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c
index 573af69..7d9255f 100644
--- a/shell/ev-sidebar-thumbnails.c
+++ b/shell/ev-sidebar-thumbnails.c
@@ -31,6 +31,7 @@
#include "ev-sidebar-thumbnails.h"
#include "ev-document-thumbnails.h"
+#include "ev-document-misc.h"
#include "ev-utils.h"
#define THUMBNAIL_WIDTH 75
@@ -224,9 +225,13 @@ void
ev_sidebar_thumbnails_set_document (EvSidebarThumbnails *sidebar_thumbnails,
EvDocument *document)
{
- GtkIconTheme *theme;
GdkPixbuf *loading_icon;
gint i, n_pages;
+ GtkTreeIter iter;
+ gchar *page;
+ gint width = THUMBNAIL_WIDTH;
+ gint height = THUMBNAIL_WIDTH;
+
EvSidebarThumbnailsPrivate *priv = sidebar_thumbnails->priv;
g_return_if_fail (EV_IS_DOCUMENT_THUMBNAILS (document));
@@ -234,32 +239,27 @@ ev_sidebar_thumbnails_set_document (EvSidebarThumbnails *sidebar_thumbnails,
if (priv->idle_id != 0) {
g_source_remove (priv->idle_id);
}
-
- theme = gtk_icon_theme_get_for_screen (gtk_widget_get_screen (GTK_WIDGET (sidebar_thumbnails)));
+ n_pages = ev_document_get_n_pages (document);
+
+ priv->document = document;
+ priv->idle_id = g_idle_add (populate_thumbnails_idle, sidebar_thumbnails);
+ priv->n_pages = n_pages;
+ priv->current_page = 0;
- loading_icon = gtk_icon_theme_load_icon (theme, "gnome-fs-loading-icon",
- THUMBNAIL_WIDTH, 0, NULL);
+ /* We get the dimensions of the first doc so that */
+ ev_document_thumbnails_get_dimensions (EV_DOCUMENT_THUMBNAILS (priv->document),
+ 0, THUMBNAIL_WIDTH, &width, &height);
+ loading_icon = ev_document_misc_get_thumbnail_frame (width, height, NULL);
- n_pages = ev_document_get_n_pages (document);
-
for (i = 0; i < n_pages; i++) {
- GtkTreeIter iter;
- gchar *page;
-
page = g_strdup_printf ("<i>%d</i>", i + 1);
- gtk_list_store_append (sidebar_thumbnails->priv->list_store,
- &iter);
- gtk_list_store_set (sidebar_thumbnails->priv->list_store,
- &iter,
+ gtk_list_store_append (priv->list_store, &iter);
+ gtk_list_store_set (priv->list_store, &iter,
COLUMN_PAGE_STRING, page,
COLUMN_PIXBUF, loading_icon,
-1);
g_free (page);
}
- priv->document = document;
- priv->idle_id = g_idle_add (populate_thumbnails_idle, sidebar_thumbnails);
- priv->n_pages = n_pages;
- priv->current_page = 0;
}