]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-sidebar-thumbnails.c
Put the toolbar xml in evince own dot dir
[evince.git] / shell / ev-sidebar-thumbnails.c
index a22d70ebd70dd8717a91462e45eec03f66f88862..61d3cb838c2eb6e2673c0c64b427e386f8323fc4 100644 (file)
@@ -163,6 +163,12 @@ ev_sidebar_tree_selection_changed (GtkTreeSelection *selection,
        ev_page_cache_set_current_page (page_cache, page);
 }
 
+GtkWidget *
+ev_sidebar_thumbnails_get_treeview (EvSidebarThumbnails *sidebar)
+{
+       return sidebar->priv->tree_view;
+}
+
 static void
 ev_sidebar_thumbnails_init (EvSidebarThumbnails *ev_sidebar_thumbnails)
 {
@@ -214,16 +220,12 @@ page_changed_cb (EvPageCache         *page_cache,
                 int                  page,
                 EvSidebarThumbnails *sidebar)
 {
+       GtkTreeView *tree_view = GTK_TREE_VIEW (sidebar->priv->tree_view);
        GtkTreePath *path;
-       GtkTreeSelection *selection;
 
        path = gtk_tree_path_new_from_indices (page, -1);
-       selection = gtk_tree_view_get_selection
-                       (GTK_TREE_VIEW (sidebar->priv->tree_view));
-
-       gtk_tree_selection_select_path (selection, path);
-       gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (sidebar->priv->tree_view),
-                                     path, NULL, FALSE, 0.0, 0.0);
+       gtk_tree_view_set_cursor (tree_view, path, NULL, FALSE);
+       gtk_tree_view_scroll_to_cell (tree_view, path, NULL, FALSE, 0.0, 0.0);
        gtk_tree_path_free (path);
 }
 
@@ -267,10 +269,10 @@ ev_sidebar_thumbnails_set_document (EvSidebarPage *sidebar_page,
 
        /* We get the dimensions of the first doc so that we can make a blank
         * icon.  */
-       g_mutex_lock (EV_DOC_MUTEX);
+       ev_document_doc_mutex_lock ();
        ev_document_thumbnails_get_dimensions (EV_DOCUMENT_THUMBNAILS (priv->document),
                                               0, THUMBNAIL_WIDTH, &width, &height);
-       g_mutex_unlock (EV_DOC_MUTEX);
+       ev_document_doc_mutex_unlock ();
 
        loading_icon = ev_document_misc_get_thumbnail_frame (width, height, NULL);