]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-window.c
[shell] Focus the selected annotation in the sidebar
[evince.git] / shell / ev-window.c
index 9228f4a348eede8aed01077017a0ebfeb6057088..168ed67d4aeb24e79c0dd52df8e89e2bf9f2530b 100644 (file)
@@ -5375,6 +5375,14 @@ sidebar_layers_visibility_changed (EvSidebarLayers *layers,
        ev_view_reload (EV_VIEW (window->priv->view));
 }
 
+static void
+sidebar_annots_annot_activated_cb (EvSidebarAnnotations *sidebar_annots,
+                                  EvMapping            *annot_mapping,
+                                  EvWindow             *window)
+{
+       ev_view_focus_annotation (EV_VIEW (window->priv->view), annot_mapping);
+}
+
 static void
 register_custom_actions (EvWindow *window, GtkActionGroup *group)
 {
@@ -6537,6 +6545,10 @@ ev_window_init (EvWindow *ev_window)
 
        sidebar_widget = ev_sidebar_annotations_new ();
        ev_window->priv->sidebar_annots = sidebar_widget;
+       g_signal_connect (sidebar_widget,
+                         "annot_activated",
+                         G_CALLBACK (sidebar_annots_annot_activated_cb),
+                         ev_window);
        gtk_widget_show (sidebar_widget);
        ev_sidebar_add_page (EV_SIDEBAR (ev_window->priv->sidebar),
                             sidebar_widget);