[sysprof] callgraph view: Expand cursor row on Right



commit 28d9a7d8b433202b9deff64f34973a04b12b4a00
Author: Timm Bäder <mail baedert org>
Date:   Sun Jun 5 10:47:20 2016 +0200

    callgraph view: Expand cursor row on Right

 lib/sp-callgraph-view.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/lib/sp-callgraph-view.c b/lib/sp-callgraph-view.c
index 02cc17b..fc41230 100644
--- a/lib/sp-callgraph-view.c
+++ b/lib/sp-callgraph-view.c
@@ -667,6 +667,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)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]