From c534f00366389b462ad9da255c55be778518e0aa Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Mon, 7 Sep 2026 22:45:57 -0300 Subject: [PATCH] event-widget: Rework transparency of past events Instead of applying the "dimmed" CSS class - which comes from Adwaita and applies an overall opacity change - add a new custom "past" CSS class and change the opacity of specific elements. This avoids opacity in the group, which in turn allows GTK to avoid rendering these event widgets in offscreens, which should be faster. Part-of: --- src/gui/gcal-event-widget.c | 4 ++-- src/theme/events.css | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gui/gcal-event-widget.c b/src/gui/gcal-event-widget.c index 06e432f3..05d34f3b 100644 --- a/src/gui/gcal-event-widget.c +++ b/src/gui/gcal-event-widget.c @@ -196,9 +196,9 @@ update_color (GcalEventWidget *self) /* Fades out an event that's earlier than the current date */ if (date_compare < 0) - gtk_widget_add_css_class (GTK_WIDGET (self), "dimmed"); + gtk_widget_add_css_class (GTK_WIDGET (self), "past"); else - gtk_widget_remove_css_class (GTK_WIDGET (self), "dimmed"); + gtk_widget_remove_css_class (GTK_WIDGET (self), "past"); /* Remove the old style class */ if (self->css_class) diff --git a/src/theme/events.css b/src/theme/events.css index 8d22a5b3..c0d07c55 100644 --- a/src/theme/events.css +++ b/src/theme/events.css @@ -41,6 +41,15 @@ event widget.edge { min-width: 6px; } +event.past { + background-color: color-mix(in srgb, var(--event-bg-color) 10%, var(--view-bg-color)); + color: color-mix(in srgb, var(--view-fg-color) 60%, transparent); +} + +event.past widget.edge { + background-color: color-mix(in srgb, var(--event-bg-color) 20%, transparent); +} + event.slanted widget.edge, event.slanted-start widget.edge { background-color: transparent;