From 030f3700154ba4f253d3d17ac59afce83eb2548d Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Fri, 4 Aug 2023 21:27:01 -0300 Subject: [PATCH] month-cell: Don't change inscription visibility Let's just change the text and preserve the visibility of the inscription. --- src/gui/views/gcal-month-cell.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/gui/views/gcal-month-cell.c b/src/gui/views/gcal-month-cell.c index 2aaba8dd..15be47ba 100644 --- a/src/gui/views/gcal-month-cell.c +++ b/src/gui/views/gcal-month-cell.c @@ -484,20 +484,24 @@ void gcal_month_cell_set_overflow (GcalMonthCell *self, guint n_overflow) { - g_autofree gchar *text = NULL; - g_return_if_fail (GCAL_IS_MONTH_CELL (self)); - gtk_widget_set_child_visible (GTK_WIDGET (self->overflow_inscription), n_overflow > 0); - gtk_widget_set_sensitive (self->overflow_button, n_overflow > 0); - if (self->n_overflow == n_overflow) return; self->n_overflow = n_overflow; - text = g_strdup_printf ("+%d", n_overflow); - gtk_inscription_set_text (self->overflow_inscription, text); + gtk_widget_set_sensitive (self->overflow_button, n_overflow > 0); + + if (n_overflow > 0) + { + g_autofree gchar *text = g_strdup_printf ("+%d", n_overflow); + gtk_inscription_set_text (self->overflow_inscription, text); + } + else + { + gtk_inscription_set_text (self->overflow_inscription, ""); + } } gint