[gtk/wip/matthiasc/css-values] inspector: Show change in the css node tree
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/css-values] inspector: Show change in the css node tree
- Date: Mon, 13 Jan 2020 23:49:26 +0000 (UTC)
commit d9ce6db0d3ea847016e5a588912b8e5914fb219d
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Jan 13 18:48:12 2020 -0500
inspector: Show change in the css node tree
This is useful for debugging why we update to damn much
css on enter/leave.
gtk/inspector/css-node-tree.c | 11 +++++++++++
gtk/inspector/css-node-tree.ui | 14 ++++++++++++++
2 files changed, 25 insertions(+)
---
diff --git a/gtk/inspector/css-node-tree.c b/gtk/inspector/css-node-tree.c
index 11741e7c79..fe755a0585 100644
--- a/gtk/inspector/css-node-tree.c
+++ b/gtk/inspector/css-node-tree.c
@@ -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);
diff --git a/gtk/inspector/css-node-tree.ui b/gtk/inspector/css-node-tree.ui
index f05edfc5d6..066eae86ef 100644
--- a/gtk/inspector/css-node-tree.ui
+++ b/gtk/inspector/css-node-tree.ui
@@ -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>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]