inspector: Show change in the css node tree
This is useful for debugging why we update to damn much css on enter/leave.
This commit is contained in:
@@ -52,6 +52,7 @@ enum {
|
||||
COLUMN_NODE_CLASSES,
|
||||
COLUMN_NODE_ID,
|
||||
COLUMN_NODE_STATE,
|
||||
COLUMN_NODE_CHANGE,
|
||||
/* add more */
|
||||
N_NODE_COLUMNS
|
||||
};
|
||||
@@ -337,6 +338,15 @@ gtk_inspector_css_node_tree_get_node_value (GtkTreeModelCssNode *model,
|
||||
g_value_take_string (value, format_state_flags (gtk_css_node_get_state (node)));
|
||||
break;
|
||||
|
||||
case COLUMN_NODE_CHANGE:
|
||||
{
|
||||
GtkCssStyle *style = gtk_css_node_get_style (node);
|
||||
GtkCssStaticStyle *static_style = GTK_CSS_STATIC_STYLE (gtk_css_style_get_static_style (style));
|
||||
GtkCssChange change = gtk_css_static_style_get_change (static_style);
|
||||
g_value_take_string (value, gtk_css_change_to_string (change));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
@@ -359,6 +369,7 @@ gtk_inspector_css_node_tree_init (GtkInspectorCssNodeTree *cnt)
|
||||
G_TYPE_BOOLEAN,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING);
|
||||
gtk_tree_view_set_model (GTK_TREE_VIEW (priv->node_tree), priv->node_model);
|
||||
g_object_unref (priv->node_model);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<column type="gchararray"/>
|
||||
<column type="gchararray"/>
|
||||
<column type="gint"/>
|
||||
<column type="gchararray"/>
|
||||
</columns>
|
||||
</object>
|
||||
<template class="GtkInspectorCssNodeTree" parent="GtkBox">
|
||||
@@ -80,6 +81,19 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTreeViewColumn" id="node_change_column">
|
||||
<property name="resizable">1</property>
|
||||
<property name="title" translatable="yes">Change</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererText"/>
|
||||
<attributes>
|
||||
<attribute name="text">5</attribute>
|
||||
<attribute name="sensitive">1</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
Reference in New Issue
Block a user