+static void
+adjustment_changed_cb (GtkAdjustment *adjustment,
+ EvSidebarThumbnails *ev_sidebar_thumbnails)
+{
+ EvSidebarThumbnailsPrivate *priv;
+ GtkTreePath *path;
+ GtkTreeIter iter;
+ int page;
+ gboolean thumbnail_set;
+
+ priv = ev_sidebar_thumbnails->priv = EV_SIDEBAR_THUMBNAILS_GET_PRIVATE (ev_sidebar_thumbnails);
+
+ gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (priv->tree_view),
+ 1, 1, &path,
+ NULL, NULL, NULL);
+ if (!path)
+ return;
+
+ page = gtk_tree_path_get_indices (path)[0];
+ gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->list_store),
+ &iter, path);
+ gtk_tree_model_get (GTK_TREE_MODEL (priv->list_store), &iter,
+ COLUMN_THUMBNAIL_SET, &thumbnail_set,
+ -1);
+}
+
+static void
+ev_sidebar_tree_selection_changed (GtkTreeSelection *selection,
+ EvSidebarThumbnails *ev_sidebar_thumbnails)
+{
+ EvSidebarThumbnailsPrivate *priv;
+ EvPageCache *page_cache;
+ GtkTreePath *path;
+ GtkTreeIter iter;
+ int page;
+
+ priv = ev_sidebar_thumbnails->priv = EV_SIDEBAR_THUMBNAILS_GET_PRIVATE (ev_sidebar_thumbnails);
+
+ if (!gtk_tree_selection_get_selected (selection, NULL, &iter))
+ return;
+
+ path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->list_store),
+ &iter);
+ page = gtk_tree_path_get_indices (path)[0];
+ gtk_tree_path_free (path);
+
+ page_cache = ev_document_get_page_cache (priv->document);
+ ev_page_cache_set_current_page (page_cache, page);