From cd4a22ed4b8fa3685e96370154fd790462081409 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 22 Jul 2022 14:46:59 -0700 Subject: [PATCH] libsysprof-ui: use AdwPreferencesPage for memprof page --- src/libsysprof-ui/sysprof-memprof-page.c | 13 +- src/libsysprof-ui/sysprof-memprof-page.ui | 164 ++++++---------------- 2 files changed, 49 insertions(+), 128 deletions(-) diff --git a/src/libsysprof-ui/sysprof-memprof-page.c b/src/libsysprof-ui/sysprof-memprof-page.c index 58f3079e..00e98961 100644 --- a/src/libsysprof-ui/sysprof-memprof-page.c +++ b/src/libsysprof-ui/sysprof-memprof-page.c @@ -44,7 +44,6 @@ #include "../stackstash.h" #include "egg-paned-private.h" -#include "egg-three-grid.h" #include "sysprof-cell-renderer-percent.h" #include "sysprof-memprof-page.h" @@ -68,7 +67,6 @@ typedef struct GtkLabel *temp_allocs_count; GtkLabel *num_allocs; GtkLabel *leaked_allocs; - GtkLabel *peak_allocs; GtkListBox *by_size; GtkWidget *callgraph; GtkWidget *summary_page; @@ -226,7 +224,14 @@ update_summary (SysprofMemprofPage *self, title = gtk_label_new (NULL); subtitle = gtk_label_new (NULL); prog = gtk_level_bar_new_for_interval (0, stats.n_allocs); - box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 3); + box = g_object_new (GTK_TYPE_BOX, + "orientation", GTK_ORIENTATION_VERTICAL, + "spacing", 6, + "margin-top", 6, + "margin-start", 6, + "margin-bottom", 6, + "margin-end", 6, + NULL); sizestr = g_format_size_full (stats.by_size[i].bucket, G_FORMAT_SIZE_IEC_UNITS); if (i == 0) @@ -1155,7 +1160,6 @@ sysprof_memprof_page_class_init (SysprofMemprofPageClass *klass) gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, num_allocs); gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, leaked_allocs); gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, leaked_allocs_button); - gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, peak_allocs); gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, loading_state); gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, empty_state); gtk_widget_class_bind_template_child_private (widget_class, SysprofMemprofPage, summary_page); @@ -1167,7 +1171,6 @@ sysprof_memprof_page_class_init (SysprofMemprofPageClass *klass) gtk_widget_class_add_binding_signal (widget_class, GDK_KEY_Left, GDK_ALT_MASK, "go-previous", NULL); g_type_ensure (EGG_TYPE_PANED); - g_type_ensure (EGG_TYPE_THREE_GRID); g_type_ensure (SYSPROF_TYPE_CELL_RENDERER_PERCENT); } diff --git a/src/libsysprof-ui/sysprof-memprof-page.ui b/src/libsysprof-ui/sysprof-memprof-page.ui index 1fbc12ee..30a98348 100644 --- a/src/libsysprof-ui/sysprof-memprof-page.ui +++ b/src/libsysprof-ui/sysprof-memprof-page.ui @@ -55,147 +55,65 @@ - - never + - - 16 - 16 - 16 - 16 - vertical + - - true - 6 - 18 - - - Peak Allocation - end - false - - - left - 0 - - - - - - 0 - true - false - - center - 0 - - - - - - Number of Allocations - end - - - left - 1 - - - - + + false + Number of Allocations + Total number of allocation and free records + - 0 + true + 1 true - - center - 1 - - - - Leaked Allocations - end - false - - - left - 2 - - - - + + + + + false + Leaked Allocations + Number of allocations without a free record + - 0 + true + 1 true - false - - center - 2 - - - - Temporary Allocations - end - - - left - 3 - - - - + + + + + false + Temporary Allocations + Number of allocations freed from similar stack trace + - 0 + true + 1 true - 50 - - center - 3 - - - - - - Allocations by Size - end - start - - - left - 4 - - - - - - - - - - - center - 4 - + + + Allocations by Size + + + + + + +