diff options
author | Søren Sandmann Pedersen <sandmann@daimi.au.dk> | 2010-11-09 09:13:26 -0500 |
---|---|---|
committer | Søren Sandmann Pedersen <sandmann@daimi.au.dk> | 2011-06-29 02:48:21 -0400 |
commit | bb50c1ef214e1dc8f307ed055b0412f5d7002284 (patch) | |
tree | eb578f6ba480b33d15cde049a30f1e4c8abc8d79 | |
parent | faab5f84e59ceff827d9399ce1330c7fb27af896 (diff) |
Make sure there is always a caller in the callers view.
This hacks around a GTK+ bug where the initial size allocation is
screwed up for empty tree views.
-rw-r--r-- | sysprof.c | 22 |
1 files changed, 21 insertions, 1 deletions
@@ -486,10 +486,22 @@ add_callers (GtkListStore *list_store, Profile *profile, ProfileCaller *callers) { + GtkTreeIter iter; + + if (!callers) + { + gtk_list_store_append (list_store, &iter); + + gtk_list_store_set ( + list_store, &iter, + CALLERS_NAME, "", + CALLERS_SELF, 0.0, + CALLERS_TOTAL, 0.0, -1); + } + while (callers) { gchar *name; - GtkTreeIter iter; double profile_size = profile_get_size (profile); if (callers->name) @@ -1120,6 +1132,14 @@ on_object_selection_changed (GtkTreeSelection *selection, fill_callers_list (app); + gtk_tree_view_columns_autosize (app->callers_view); + + gtk_widget_set_size_request (app->callers_view, 2, 2); + gtk_widget_hide (app->callers_view); + gtk_widget_show (app->callers_view); + + gtk_widget_set_size_request (app->callers_view, -1, -1); + #if 0 if (get_current_object (app)) expand_descendants_tree (app); |