Use gtk_widget_add/remove_css_class() where possible

This makes the code simpler and more idiomatic to GTK 4.
This commit is contained in:
Adrien Plazas
2022-05-10 13:01:25 +02:00
parent 2fd20f72a8
commit aecfebcc9d
9 changed files with 12 additions and 24 deletions
+2 -6
View File
@@ -425,8 +425,6 @@ void
gcal_month_cell_set_different_month (GcalMonthCell *self,
gboolean different)
{
GtkStyleContext *context;
g_return_if_fail (GCAL_IS_MONTH_CELL (self));
if (self->different_month == different)
@@ -434,12 +432,10 @@ gcal_month_cell_set_different_month (GcalMonthCell *self,
self->different_month = different;
context = gtk_widget_get_style_context (GTK_WIDGET (self));
if (different)
gtk_style_context_add_class (context, "out-of-month");
gtk_widget_add_css_class (GTK_WIDGET (self), "out-of-month");
else
gtk_style_context_remove_class (context, "out-of-month");
gtk_widget_remove_css_class (GTK_WIDGET (self), "out-of-month");
}
GcalContext*