diff --git a/lib/sp-callgraph-view.c b/lib/sp-callgraph-view.c index 02cc17b8..fc41230c 100644 --- a/lib/sp-callgraph-view.c +++ b/lib/sp-callgraph-view.c @@ -666,6 +666,24 @@ sp_callgraph_view_set_property (GObject *object, } } +static void +descendants_view_move_cursor_cb (GtkTreeView *descendants_view, + GtkMovementStep step, + int direction, + gpointer user_data) +{ + if (step == GTK_MOVEMENT_VISUAL_POSITIONS && direction == 1) + { + GtkTreePath *path; + gtk_tree_view_get_cursor (descendants_view, &path, NULL); + gtk_tree_view_expand_row (descendants_view, path, FALSE); + + g_signal_stop_emission_by_name (descendants_view, "move-cursor"); + + gtk_tree_path_free (path); + } +} + static void sp_callgraph_view_class_init (SpCallgraphViewClass *klass) { @@ -738,6 +756,12 @@ sp_callgraph_view_init (SpCallgraphView *self) self, G_CONNECT_SWAPPED); + g_signal_connect (priv->descendants_view, + "move-cursor", + G_CALLBACK (descendants_view_move_cursor_cb), + NULL); + + cell = g_object_new (GTK_TYPE_CELL_RENDERER_TEXT, "foreground", "#666666", "scale", PANGO_SCALE_SMALL,