From f06e050d41051f1ea95b40981aee32ef8e0b0bae Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Sat, 12 Mar 2005 09:56:03 +0000 Subject: Fix the mess we did with thumbnails and 1-basedness 2005-03-12 Marco Pesenti Gritti * pdf/pdf-document.cc: * shell/ev-sidebar-thumbnails.c: (adjustment_changed_cb), (do_one_iteration), (ev_sidebar_thumbnails_set_document): Fix the mess we did with thumbnails and 1-basedness --- (limited to 'shell/ev-sidebar-thumbnails.c') diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c index b602bb2..b4622f6 100644 --- a/shell/ev-sidebar-thumbnails.c +++ b/shell/ev-sidebar-thumbnails.c @@ -111,7 +111,7 @@ adjustment_changed_cb (GtkAdjustment *adjustment, if (!path) return; - page = gtk_tree_path_get_indices (path)[0]; + page = gtk_tree_path_get_indices (path)[0] + 1; if (page == priv->current_page) return; gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->list_store), @@ -119,7 +119,7 @@ adjustment_changed_cb (GtkAdjustment *adjustment, gtk_tree_model_get (GTK_TREE_MODEL (priv->list_store), &iter, COLUMN_THUMBNAIL_SET, &thumbnail_set, -1); - if (! thumbnail_set) { + if (!thumbnail_set) { priv->current_page = page; priv->current_page_iter = iter; @@ -239,8 +239,8 @@ do_one_iteration (EvSidebarThumbnails *ev_sidebar_thumbnails) priv->current_page++; - if (priv->current_page == priv->n_pages) { - priv->current_page = 0; + if (priv->current_page > priv->n_pages) { + priv->current_page = 1; gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->list_store), &(priv->current_page_iter)); } else { @@ -378,7 +378,7 @@ ev_sidebar_thumbnails_set_document (EvSidebarThumbnails *sidebar_thumbnails, g_object_unref (loading_icon); gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->list_store), &(priv->current_page_iter)); - priv->current_page = 0; + priv->current_page = 1; priv->pages_done = 0; } -- cgit v0.9.1