[sysprof/newui: 10/24] Reorder columns
- From: SÃren Sandmann Pedersen <ssp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sysprof/newui: 10/24] Reorder columns
- Date: Wed, 29 Jun 2011 06:38:43 +0000 (UTC)
commit d2d05751ae5c75a97fd18fa64ac87d03b60fc523
Author: SÃren Sandmann Pedersen <sandmann daimi au dk>
Date: Tue Nov 9 08:46:15 2010 -0500
Reorder columns
sysprof.c | 13 +++++++------
sysprof.glade | 4 ++--
treeviewutils.c | 6 ++++++
3 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/sysprof.c b/sysprof.c
index f911e1d..d7d125e 100644
--- a/sysprof.c
+++ b/sysprof.c
@@ -387,9 +387,9 @@ enum
enum
{
- DESCENDANTS_NAME,
DESCENDANTS_SELF,
DESCENDANTS_CUMULATIVE,
+ DESCENDANTS_NAME,
DESCENDANTS_OBJECT
};
@@ -448,9 +448,9 @@ fill_descendants_tree (Application *app)
tree_store =
foo_tree_store_new (4,
- G_TYPE_STRING,
G_TYPE_DOUBLE,
G_TYPE_DOUBLE,
+ G_TYPE_STRING,
G_TYPE_POINTER);
if (app->profile)
@@ -1267,7 +1267,7 @@ set_sizes (GtkWindow *window,
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
- width = 5 * (monitor.width / 13);
+ width = 3 * (monitor.width / 8);
height = 0.9 * monitor.height;
gtk_window_resize (window, width, height);
@@ -1478,13 +1478,14 @@ build_gui (Application *app)
/* descendants view */
gtk_tree_view_set_enable_search (app->descendants_view, FALSE);
- col = add_plain_text_column (app->descendants_view, _("Descendants"),
- DESCENDANTS_NAME);
add_double_format_column (app->descendants_view, _("Self"),
DESCENDANTS_SELF, PCT_FORMAT);
- add_double_format_column (app->descendants_view, _("Cumulative"),
+ add_double_format_column (app->descendants_view, _("Total"),
DESCENDANTS_CUMULATIVE, PCT_FORMAT);
+ col = add_plain_text_column (app->descendants_view, _("Name"),
+ DESCENDANTS_NAME);
gtk_tree_view_column_set_expand (col, TRUE);
+ gtk_tree_view_set_expander_column (app->descendants_view, col);
/* screenshot window */
diff --git a/sysprof.glade b/sysprof.glade
index 4263841..9433f1b 100644
--- a/sysprof.glade
+++ b/sysprof.glade
@@ -689,7 +689,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
- <property name="rules_hint">True</property>
+ <property name="rules_hint">False</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
<property name="fixed_height_mode">False</property>
@@ -718,7 +718,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
- <property name="rules_hint">True</property>
+ <property name="rules_hint">False</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
<property name="fixed_height_mode">False</property>
diff --git a/treeviewutils.c b/treeviewutils.c
index 20d7777..a73de20 100644
--- a/treeviewutils.c
+++ b/treeviewutils.c
@@ -31,6 +31,8 @@ typedef struct
GtkSortType default_order;
} SortInfo;
+#define PADDING 12
+
static void
set_sort_info (GtkTreeView *view,
GtkTreeViewColumn *column,
@@ -142,6 +144,9 @@ add_plain_text_column (GtkTreeView *view, const gchar *title, gint model_column)
renderer = gtk_cell_renderer_text_new ();
g_object_set (renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+#if 0
+ g_object_set (renderer, "xpad", PADDING, NULL);
+#endif
column = gtk_tree_view_column_new_with_attributes (title, renderer,
"text", model_column,
NULL);
@@ -210,6 +215,7 @@ add_double_format_column (GtkTreeView *view,
renderer = gtk_cell_renderer_text_new ();
g_object_set (renderer, "xalign", 1.0, NULL);
+ g_object_set (renderer, "xpad", PADDING, NULL);
column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_title (column, title);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]