X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=blobdiff_plain;f=shell%2Fev-sidebar-thumbnails.c;h=61d3cb838c2eb6e2673c0c64b427e386f8323fc4;hb=1a1099e24c625b8ab7816f1ec1ff85cb8e2880d4;hp=a22d70ebd70dd8717a91462e45eec03f66f88862;hpb=e6e647fb236b236df1399ff4dba8faf0172002a1;p=evince.git diff --git a/shell/ev-sidebar-thumbnails.c b/shell/ev-sidebar-thumbnails.c index a22d70eb..61d3cb83 100644 --- a/shell/ev-sidebar-thumbnails.c +++ b/shell/ev-sidebar-thumbnails.c @@ -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);