From 69338ee16e11fde06cfe646e4d43e9f06af0cbc4 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Tue, 30 Aug 2016 13:01:16 -0700 Subject: [PATCH] callgraph-view: collapse row with Left Arrow This makes Left Arrow do the opposite of Right Arrow. --- lib/sp-callgraph-view.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/sp-callgraph-view.c b/lib/sp-callgraph-view.c index 2260d0b6..57ea35cb 100644 --- a/lib/sp-callgraph-view.c +++ b/lib/sp-callgraph-view.c @@ -671,13 +671,22 @@ descendants_view_move_cursor_cb (GtkTreeView *descendants_view, int direction, gpointer user_data) { - if (step == GTK_MOVEMENT_VISUAL_POSITIONS && direction == 1) + if (step == GTK_MOVEMENT_VISUAL_POSITIONS) { 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_view_get_cursor (descendants_view, &path, NULL); + + if (direction == 1) + { + gtk_tree_view_expand_row (descendants_view, path, FALSE); + g_signal_stop_emission_by_name (descendants_view, "move-cursor"); + } + else if (direction == -1) + { + gtk_tree_view_collapse_row (descendants_view, path); + g_signal_stop_emission_by_name (descendants_view, "move-cursor"); + } gtk_tree_path_free (path); }