move code

This commit is contained in:
Christian Hergert
2019-05-20 17:45:24 -07:00
parent 72456bd1c4
commit 1d4d5e7022

View File

@ -663,6 +663,33 @@ sysprof_callgraph_view_real_go_previous (SysprofCallgraphView *self)
sysprof_callgraph_view_set_node (self, node);
}
static void
descendants_view_move_cursor_cb (GtkTreeView *descendants_view,
GtkMovementStep step,
int direction,
gpointer user_data)
{
if (step == GTK_MOVEMENT_VISUAL_POSITIONS)
{
GtkTreePath *path;
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);
}
}
static void
sysprof_callgraph_view_finalize (GObject *object)
{
@ -714,33 +741,6 @@ sysprof_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)
{
GtkTreePath *path;
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);
}
}
static void
sysprof_callgraph_view_class_init (SysprofCallgraphViewClass *klass)
{