callgraph view: Expand cursor row on Right

This commit is contained in:
Timm Bäder
2016-06-05 10:47:20 +02:00
parent 96c8032ab0
commit 28d9a7d8b4

View File

@ -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,