From 618c4ac575b44d966b780540e1b2b40640190e84 Mon Sep 17 00:00:00 2001 From: Alice Mikhaylenko Date: Mon, 24 Jun 2024 01:41:30 +0400 Subject: [PATCH 1/4] progress-cell: Simplify styles --- src/sysprof/style.css | 15 ++------------- src/sysprof/sysprof-progress-cell.c | 2 ++ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/sysprof/style.css b/src/sysprof/style.css index 752d73c7..03e7d775 100644 --- a/src/sysprof/style.css +++ b/src/sysprof/style.css @@ -1,26 +1,15 @@ progresscell progress { background: @accent_bg_color; - border-radius: 3px; - border: 1px solid shade(@accent_bg_color, .75); border-right: none; } progresscell { - min-height: 18px; -} - -progresscell progress:backdrop { - background: @borders; - border-color: shade(@borders, .9); -} -progresscell label:backdrop.in-progress { - color: inherit; + min-height: 18px; + border-radius: 3px; } progresscell trough { background: alpha(@borders, .5); - border: 1px solid @borders; - border-radius: 3px; } progresscell label { diff --git a/src/sysprof/sysprof-progress-cell.c b/src/sysprof/sysprof-progress-cell.c index 51b399b3..867b6754 100644 --- a/src/sysprof/sysprof-progress-cell.c +++ b/src/sysprof/sysprof-progress-cell.c @@ -242,6 +242,8 @@ sysprof_progress_cell_init (SysprofProgressCell *self) gtk_widget_set_parent (GTK_WIDGET (self->progress), GTK_WIDGET (self)); gtk_widget_set_parent (GTK_WIDGET (self->alt_label), GTK_WIDGET (self)); + gtk_widget_set_overflow (GTK_WIDGET (self), GTK_OVERFLOW_HIDDEN); + gtk_accessible_update_property (GTK_ACCESSIBLE (self), GTK_ACCESSIBLE_PROPERTY_VALUE_MAX, 1.0, GTK_ACCESSIBLE_PROPERTY_VALUE_MIN, 0.0, From 3597106de80e9907552643a72cc00f803f89fb20 Mon Sep 17 00:00:00 2001 From: Alice Mikhaylenko Date: Mon, 24 Jun 2024 01:51:28 +0400 Subject: [PATCH 2/4] style: Port to newer css machinery --- src/sysprof/style.css | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/sysprof/style.css b/src/sysprof/style.css index 03e7d775..86b7b79d 100644 --- a/src/sysprof/style.css +++ b/src/sysprof/style.css @@ -1,5 +1,5 @@ progresscell progress { - background: @accent_bg_color; + background: var(--accent-bg-color); border-right: none; } @@ -9,7 +9,7 @@ progresscell { } progresscell trough { - background: alpha(@borders, .5); + background: color-mix(in srgb, var(--border-color), transparent); } progresscell label { @@ -19,7 +19,7 @@ progresscell label { } progresscell label.in-progress { - color: @accent_fg_color; + color: var(--accent-fg-color); } callgraphview { @@ -39,32 +39,31 @@ callgraphview row:not(:selected) treeexpander expander:checked+box symbol.proces callgraphview row:not(:selected) treeexpander expander:checked+box symbol.thread, callgraphview row:not(:selected) treeexpander expander:checked+box symbol.root { border-radius: 9999px; - background-color: alpha(currentColor, .05); + background-color: color-mix(in srgb, currentColor 5%, transparent); } callgraphview row:not(:selected) treeexpander symbol.context-switch { border-radius: 9999px; - background-color: alpha(@warning_color, .1); + background-color: color-mix(in srgb, var(--warning-color) 10%, transparent); } callgraphview row:not(:selected) treeexpander symbol.unwindable { border-radius: 9999px; - background-color: alpha(@error_color, .1); + background-color: color-mix(in srgb, var(--error-color) 10%, transparent); } timeruler { min-height: 24px; font-size: 0.833em; - color: alpha(currentColor, .8); + color: color-mix(in srgb, currentColor 80%, transparent); } timescrubber informative, timescrubber timecode { border-radius: 7px; - background: @accent_bg_color; - color: @accent_fg_color; + background: var(--accent-bg-color); + color: var(--accent-fg-color); padding: 1px 3px; margin: 2px 6px; - box-shadow: 0 2px 8px 2px alpha(black, .27); - border: 1px solid shade(@accent_bg_color, .9); + box-shadow: 0 2px 8px 2px rgb(0 0 0 / 27%); font-feature-settings: "tnum"; font-size: .9em; } @@ -74,7 +73,7 @@ timescrubber timecode { } .navigation-sidebar label.indicator { - color: alpha(currentColor, .5); + color: color-mix(in srgb, currentColor, transparent); border-radius: 50px; padding: 1px 5px; font-feature-settings: 'tnum'; From cb3171d7bb376921eab8bce70ed897789e1c882b Mon Sep 17 00:00:00 2001 From: Alice Mikhaylenko Date: Mon, 24 Jun 2024 01:53:28 +0400 Subject: [PATCH 3/4] chart-layer: Redraw on css changes Make sure we redraw it when system accent color changes. --- src/sysprof/sysprof-chart-layer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sysprof/sysprof-chart-layer.c b/src/sysprof/sysprof-chart-layer.c index b1c3db9a..675ee33d 100644 --- a/src/sysprof/sysprof-chart-layer.c +++ b/src/sysprof/sysprof-chart-layer.c @@ -58,6 +58,8 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS gtk_style_context_lookup_color (style_context, "accent_fg_color", &accent_fg_color); gtk_style_context_lookup_color (style_context, "accent_bg_color", &accent_bg_color); G_GNUC_END_IGNORE_DEPRECATIONS + + gtk_widget_queue_draw (widget); } static SysprofSession * From 339dc8f30e52e3b7ba9b3749ddcf2f6f2b3abee5 Mon Sep 17 00:00:00 2001 From: Alice Mikhaylenko Date: Mon, 24 Jun 2024 02:10:00 +0400 Subject: [PATCH 4/4] processes-section: Disable autocolor for timespan layers There's only one in each row and they end up blue. --- src/sysprof/sysprof-processes-section.ui | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sysprof/sysprof-processes-section.ui b/src/sysprof/sysprof-processes-section.ui index 4452bb1a..6c707400 100644 --- a/src/sysprof/sysprof-processes-section.ui +++ b/src/sysprof/sysprof-processes-section.ui @@ -121,6 +121,7 @@ true + False