[sysprof] callgraph-view: ensure expand is set for function label



commit fc237f0a9bfd2fb0edacf1abca0ca80a164619b1
Author: Christian Hergert <chergert redhat com>
Date:   Sat Nov 12 14:22:12 2016 -0800

    callgraph-view: ensure expand is set for function label
    
    Using the .ui file to create the name cell does not allow us to set the
    expand property (it defaults to FALSE and cannot be changed). So instead,
    we just add the cell manually like we do for the tag cell.

 lib/resources/ui/sp-callgraph-view.ui |    8 --------
 lib/sp-callgraph-view.c               |    6 ++++++
 2 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/lib/resources/ui/sp-callgraph-view.ui b/lib/resources/ui/sp-callgraph-view.ui
index 2bce8d3..67cb120 100644
--- a/lib/resources/ui/sp-callgraph-view.ui
+++ b/lib/resources/ui/sp-callgraph-view.ui
@@ -146,14 +146,6 @@
                     <property name="sizing">fixed</property>
                     <property name="sort-column-id">0</property>
                     <property name="title" translatable="yes">Descendants</property>
-                    <child>
-                      <object class="GtkCellRendererText">
-                        <property name="ellipsize">middle</property>
-                      </object>
-                      <attributes>
-                        <attribute name="text">0</attribute>
-                      </attributes>
-                    </child>
                   </object>
                 </child>
                 <child>
diff --git a/lib/sp-callgraph-view.c b/lib/sp-callgraph-view.c
index 9158d3c..a960e14 100644
--- a/lib/sp-callgraph-view.c
+++ b/lib/sp-callgraph-view.c
@@ -796,6 +796,12 @@ sp_callgraph_view_init (SpCallgraphView *self)
                     G_CALLBACK (descendants_view_move_cursor_cb),
                     NULL);
 
+  cell = g_object_new (GTK_TYPE_CELL_RENDERER_TEXT,
+                       "ellipsize", PANGO_ELLIPSIZE_MIDDLE,
+                       "xalign", 0.0f,
+                       NULL);
+  gtk_tree_view_column_pack_start (priv->descendants_name_column, cell, TRUE);
+  gtk_tree_view_column_add_attribute (priv->descendants_name_column, cell, "text", 0);
 
   cell = g_object_new (GTK_TYPE_CELL_RENDERER_TEXT,
                        "foreground", "#666666",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]