event-widget: Use .dim-label instead of a hard-coded opacity

This uses the standard opacity for events of lower importance and
ensures the opacity difference is lower in HighContrast, helping
accessibility.
This commit is contained in:
Adrien Plazas
2022-06-23 16:51:56 +00:00
committed by Georges Basile Stavracas Neto
parent 4c9e7a2d03
commit bed7f9e027
+4 -1
View File
@@ -188,7 +188,10 @@ update_color (GcalEventWidget *self)
date_compare = g_date_time_compare (self->dt_end, now);
/* Fades out an event that's earlier than the current date */
gtk_widget_set_opacity (GTK_WIDGET (self), date_compare < 0 ? 0.6 : 1.0);
if (date_compare < 0)
gtk_widget_add_css_class (GTK_WIDGET (self), "dim-label");
else
gtk_widget_remove_css_class (GTK_WIDGET (self), "dim-label");
/* Remove the old style class */
if (self->css_class)