summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann <sandmann@redhat.com>2005-04-01 02:28:50 +0000
committerSøren Sandmann Pedersen <ssp@src.gnome.org>2005-04-01 02:28:50 +0000
commit5f280920c553e09812342feff01d0bb8e646ea69 (patch)
tree8f61463506580a0dc69fe0c817d9c9379a39f5a6
parent39162c394af1325ade68ede3b54333a47d1e56a7 (diff)
Right justify numbers
Thu Mar 31 21:18:13 2005 Søren Sandmann <sandmann@redhat.com> * treeviewutils.c (add_double_format_column): Right justify numbers * sysprof.c (build_gui): Add a space after the numbers * sysprof.c (on_callers_row_activated): Focus object view * sysprof.c (on_descendants_row_activated): Focus new descendants tree.
-rw-r--r--ChangeLog11
-rw-r--r--TODO1
-rw-r--r--sysprof.c28
-rw-r--r--treeviewutils.c3
4 files changed, 31 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index c498f30..0184ffa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Thu Mar 31 21:18:13 2005 Søren Sandmann <sandmann@redhat.com>
+
+ * treeviewutils.c (add_double_format_column): Right justify numbers
+
+ * sysprof.c (build_gui): Add a space after the numbers
+
+ * sysprof.c (on_callers_row_activated): Focus object view
+
+ * sysprof.c (on_descendants_row_activated): Focus new descendants
+ tree.
+
Thu Mar 31 19:51:51 2005 Søren Sandmann <sandmann@redhat.com>
* sysprof-module.c (do_generate): Walk all threads, not just all
diff --git a/TODO b/TODO
index 752733a..2160d5d 100644
--- a/TODO
+++ b/TODO
@@ -20,6 +20,7 @@ Before 1.0:
- give profiles on the command line
- autoconfuscate?
- .desktop file
+- Consider expanding a few more levels of a new descendants tree
Before 1.2:
diff --git a/sysprof.c b/sysprof.c
index a4a27fb..ed73335 100644
--- a/sysprof.c
+++ b/sysprof.c
@@ -944,8 +944,6 @@ really_goto_object (Application *app, ProfileObject *object)
gtk_tree_view_set_cursor (app->object_view, path, 0, FALSE);
}
-
- gtk_widget_grab_focus (GTK_WIDGET (app->object_view));
}
static void
@@ -976,7 +974,11 @@ on_descendants_row_activated (GtkTreeView *tree_view,
GtkTreeViewColumn *column,
gpointer data)
{
- goto_object (data, tree_view, path, DESCENDANTS_OBJECT);
+ Application *app = data;
+
+ goto_object (app, tree_view, path, DESCENDANTS_OBJECT);
+
+ gtk_widget_grab_focus (GTK_WIDGET (app->descendants_view));
}
static void
@@ -985,7 +987,11 @@ on_callers_row_activated (GtkTreeView *tree_view,
GtkTreeViewColumn *column,
gpointer data)
{
- goto_object (data, tree_view, path, CALLERS_OBJECT);
+ Application *app = data;
+
+ goto_object (app, tree_view, path, CALLERS_OBJECT);
+
+ gtk_widget_grab_focus (GTK_WIDGET (app->object_view));
}
static void
@@ -1108,9 +1114,9 @@ build_gui (Application *app)
/* object view */
app->object_view = (GtkTreeView *)glade_xml_get_widget (xml, "object_view");
- col = add_plain_text_column (app->object_view, _("Functions"), OBJECT_NAME);
- add_double_format_column (app->object_view, _("Self"), OBJECT_SELF, "%.2f");
- add_double_format_column (app->object_view, _("Total"), OBJECT_TOTAL, "%.2f");
+% col = add_plain_text_column (app->object_view, _("Functions"), OBJECT_NAME);
+ add_double_format_column (app->object_view, _("Self"), OBJECT_SELF, "%.2f ");
+ add_double_format_column (app->object_view, _("Total"), OBJECT_TOTAL, "%.2f ");
selection = gtk_tree_view_get_selection (app->object_view);
g_signal_connect (selection, "changed", G_CALLBACK (on_object_selection_changed), app);
@@ -1119,8 +1125,8 @@ build_gui (Application *app)
/* callers view */
app->callers_view = (GtkTreeView *)glade_xml_get_widget (xml, "callers_view");
col = add_plain_text_column (app->callers_view, _("Callers"), CALLERS_NAME);
- add_double_format_column (app->callers_view, _("Self"), CALLERS_SELF, "%.2f");
- add_double_format_column (app->callers_view, _("Total"), CALLERS_TOTAL, "%.2f");
+ add_double_format_column (app->callers_view, _("Self"), CALLERS_SELF, "%.2f ");
+ add_double_format_column (app->callers_view, _("Total"), CALLERS_TOTAL, "%.2f ");
g_signal_connect (app->callers_view, "row-activated",
G_CALLBACK (on_callers_row_activated), app);
@@ -1129,8 +1135,8 @@ build_gui (Application *app)
/* descendants view */
app->descendants_view = (GtkTreeView *)glade_xml_get_widget (xml, "descendants_view");
col = add_plain_text_column (app->descendants_view, _("Descendants"), DESCENDANTS_NAME);
- add_double_format_column (app->descendants_view, _("Self"), DESCENDANTS_SELF, "%.2f");
- add_double_format_column (app->descendants_view, _("Cumulative"), DESCENDANTS_NON_RECURSE, "%.2f");
+ add_double_format_column (app->descendants_view, _("Self"), DESCENDANTS_SELF, "%.2f ");
+ add_double_format_column (app->descendants_view, _("Cumulative"), DESCENDANTS_NON_RECURSE, "%.2f ");
g_signal_connect (app->descendants_view, "row-activated",
G_CALLBACK (on_descendants_row_activated), app);
diff --git a/treeviewutils.c b/treeviewutils.c
index 955e017..9217ed3 100644
--- a/treeviewutils.c
+++ b/treeviewutils.c
@@ -145,11 +145,12 @@ add_double_format_column (GtkTreeView *view, const gchar *title, gint model_colu
ColumnInfo *column_info = g_new (ColumnInfo, 1);
renderer = gtk_cell_renderer_text_new ();
+ g_object_set (renderer, "xalign", 1.0, NULL);
column = gtk_tree_view_column_new ();
gtk_tree_view_column_set_title (column, title);
gtk_tree_view_column_pack_start (column, renderer, TRUE);
- gtk_tree_view_column_set_resizable (column, TRUE);
+ gtk_tree_view_column_set_resizable (column, FALSE);
column_info->column = model_column;
column_info->format = g_strdup (format);