From 2146e16931fb768997bf5eac8b5a31302763f4c1 Mon Sep 17 00:00:00 2001 From: Christian Hergert Date: Fri, 14 Jul 2023 15:08:15 -0700 Subject: [PATCH] sysprof: add indicators to various sections This helps seeing at a glance if a recording when a bit sideways. --- src/libsysprof-gtk/style.css | 10 +++++++ src/sysprof/sysprof-logs-section.c | 10 +++++++ src/sysprof/sysprof-logs-section.ui | 11 +++++++ src/sysprof/sysprof-marks-section.c | 8 +++++ src/sysprof/sysprof-marks-section.ui | 11 +++++++ src/sysprof/sysprof-processes-section.c | 8 +++++ src/sysprof/sysprof-processes-section.ui | 11 +++++++ src/sysprof/sysprof-section.c | 38 ++++++++++++++++++++++++ src/sysprof/sysprof-section.h | 3 ++ src/sysprof/sysprof-sidebar.c | 25 ++++++++++++++++ 10 files changed, 135 insertions(+) diff --git a/src/libsysprof-gtk/style.css b/src/libsysprof-gtk/style.css index 66d42ea6..576f12cf 100644 --- a/src/libsysprof-gtk/style.css +++ b/src/libsysprof-gtk/style.css @@ -108,3 +108,13 @@ tracks row track info { .utility .view { background: transparent; } + +.navigation-sidebar label.indicator { + background: alpha(@accent_bg_color, .5); + color: @accent_fg_color; + border-radius: 50px; + padding: 1px 5px; + font-feature-settings: 'tnum'; + font-size: .8em; + border: 1px solid alpha(@accent_bg_color,.6); +} diff --git a/src/sysprof/sysprof-logs-section.c b/src/sysprof/sysprof-logs-section.c index 484d15f1..3428c6f3 100644 --- a/src/sysprof/sysprof-logs-section.c +++ b/src/sysprof/sysprof-logs-section.c @@ -24,6 +24,7 @@ #include +#include "sysprof-document-bitset-index-private.h" #include "sysprof-frame-utility.h" #include "sysprof-logs-section.h" @@ -75,6 +76,13 @@ sysprof_logs_section_activate_layer_item_cb (SysprofLogsSection *self, } } +static char * +format_number (gpointer unused, + guint number) +{ + return g_strdup_printf ("%'u", number); +} + static char * format_severity (gpointer unused, GLogLevelFlags severity) @@ -121,9 +129,11 @@ sysprof_logs_section_class_init (SysprofLogsSectionClass *klass) gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/sysprof/sysprof-logs-section.ui"); gtk_widget_class_bind_template_child (widget_class, SysprofLogsSection, column_view); gtk_widget_class_bind_template_child (widget_class, SysprofLogsSection, time_column); + gtk_widget_class_bind_template_callback (widget_class, format_number); gtk_widget_class_bind_template_callback (widget_class, format_severity); gtk_widget_class_bind_template_callback (widget_class, sysprof_logs_section_activate_layer_item_cb); + g_type_ensure (SYSPROF_TYPE_DOCUMENT_BITSET_INDEX); g_type_ensure (SYSPROF_TYPE_DOCUMENT_LOG); g_type_ensure (SYSPROF_TYPE_FRAME_UTILITY); g_type_ensure (SYSPROF_TYPE_TIME_LABEL); diff --git a/src/sysprof/sysprof-logs-section.ui b/src/sysprof/sysprof-logs-section.ui index 3329b3c1..aa44b627 100644 --- a/src/sysprof/sysprof-logs-section.ui +++ b/src/sysprof/sysprof-logs-section.ui @@ -2,6 +2,17 @@