inspector: Split out a function

This commit is contained in:
Benjamin Otte 2015-10-31 17:14:14 +01:00
parent 7568d17a15
commit b89939f5a4

View File

@ -338,20 +338,9 @@ gtk_inspector_css_node_tree_set_object (GtkInspectorCssNodeTree *cnt,
}
static void
populate_properties (GtkInspectorCssNodeTree *cnt)
gtk_inspector_css_node_tree_set_node (GtkInspectorCssNodeTree *cnt,
GtkCssNode *node)
{
GtkInspectorCssNodeTreePrivate *priv = cnt->priv;
GtkTreeSelection *selection;
GtkTreeIter titer;
GtkCssNode *node;
GtkCssStyle *style;
gint i;
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->node_tree));
if (!gtk_tree_selection_get_selected (selection, NULL, &titer))
return;
node = gtk_tree_model_css_node_get_node_from_iter (GTK_TREE_MODEL_CSS_NODE (priv->node_model), &titer);
style = gtk_css_node_get_style (node);
for (i = 0; i < _gtk_css_style_property_get_n_properties (); i++)
@ -387,4 +376,22 @@ populate_properties (GtkInspectorCssNodeTree *cnt)
}
}
static void
populate_properties (GtkInspectorCssNodeTree *cnt)
{
GtkInspectorCssNodeTreePrivate *priv = cnt->priv;
GtkTreeSelection *selection;
GtkTreeIter titer;
GtkCssNode *node;
GtkCssStyle *style;
gint i;
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->node_tree));
if (!gtk_tree_selection_get_selected (selection, NULL, &titer))
return;
node = gtk_tree_model_css_node_get_node_from_iter (GTK_TREE_MODEL_CSS_NODE (priv->node_model), &titer);
gtk_inspector_css_node_tree_set_node (cnt, node);
}
// vim: set et sw=2 ts=2: