[gtk+] inspector: Show names for css nodes
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] inspector: Show names for css nodes
- Date: Fri, 23 Oct 2015 01:02:26 +0000 (UTC)
commit e0d9250a07a4aa7678d2f89bffe1302ea48c8220
Author: Matthias Clasen <mclasen redhat com>
Date: Thu Oct 22 20:58:08 2015 -0400
inspector: Show names for css nodes
Currently, we don't have any css nodes with names, but we will soon.
gtk/inspector/css-node-tree.c | 6 ++++++
gtk/inspector/css-node-tree.ui | 29 +++++++++++++++++++++--------
2 files changed, 27 insertions(+), 8 deletions(-)
---
diff --git a/gtk/inspector/css-node-tree.c b/gtk/inspector/css-node-tree.c
index 03a9a99..48b5b75 100644
--- a/gtk/inspector/css-node-tree.c
+++ b/gtk/inspector/css-node-tree.c
@@ -31,6 +31,7 @@
enum {
COLUMN_NAME,
+ COLUMN_TYPE,
COLUMN_VISIBLE,
COLUMN_CLASSES,
COLUMN_ID,
@@ -99,6 +100,10 @@ gtk_inspector_css_node_tree_get_node_value (GtkTreeModelCssNode *model,
switch (column)
{
case COLUMN_NAME:
+ g_value_set_string (value, gtk_css_node_get_name (node));
+ break;
+
+ case COLUMN_TYPE:
g_value_set_string (value, g_type_name (gtk_css_node_get_widget_type (node)));
break;
@@ -136,6 +141,7 @@ gtk_inspector_css_node_tree_init (GtkInspectorCssNodeTree *cnt)
priv->model = gtk_tree_model_css_node_new (gtk_inspector_css_node_tree_get_node_value,
N_COLUMNS,
G_TYPE_STRING,
+ G_TYPE_STRING,
G_TYPE_BOOLEAN,
G_TYPE_STRING,
G_TYPE_STRING);
diff --git a/gtk/inspector/css-node-tree.ui b/gtk/inspector/css-node-tree.ui
index f2cbab0..d9903ac 100644
--- a/gtk/inspector/css-node-tree.ui
+++ b/gtk/inspector/css-node-tree.ui
@@ -12,40 +12,53 @@
<object class="GtkTreeView" id="tree_view">
<property name="visible">True</property>
<child>
- <object class="GtkTreeViewColumn" id="treeviewcolumn1">
+ <object class="GtkTreeViewColumn">
+ <property name="resizable">True</property>
+ <property name="title" translatable="yes">Type</property>
+ <child>
+ <object class="GtkCellRendererText"/>
+ <attributes>
+ <attribute name="text">1</attribute>
+ <attribute name="sensitive">2</attribute>
+ </attributes>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkTreeViewColumn">
<property name="resizable">True</property>
<property name="title" translatable="yes">Name</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
<attribute name="text">0</attribute>
- <attribute name="sensitive">1</attribute>
+ <attribute name="sensitive">2</attribute>
</attributes>
</child>
</object>
</child>
<child>
- <object class="GtkTreeViewColumn" id="treeviewcolumn2">
+ <object class="GtkTreeViewColumn">
<property name="resizable">True</property>
<property name="title" translatable="yes">ID</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
- <attribute name="text">3</attribute>
- <attribute name="sensitive">1</attribute>
+ <attribute name="text">4</attribute>
+ <attribute name="sensitive">2</attribute>
</attributes>
</child>
</object>
</child>
<child>
- <object class="GtkTreeViewColumn" id="treeviewcolumn3">
+ <object class="GtkTreeViewColumn">
<property name="resizable">True</property>
<property name="title" translatable="yes">Classes</property>
<child>
<object class="GtkCellRendererText"/>
<attributes>
- <attribute name="text">2</attribute>
- <attribute name="sensitive">1</attribute>
+ <attribute name="text">3</attribute>
+ <attribute name="sensitive">2</attribute>
</attributes>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]