From 8dd8538014f17952607b3cfa421ac4b763c1c118 Mon Sep 17 00:00:00 2001 From: Hari Rana Date: Mon, 23 Jun 2025 08:19:02 -0400 Subject: [PATCH] views/month-cell: Use GtkWidget APIs for retrieving margin GtkStyleContext is deprecated. Part-of: --- src/gui/views/gcal-month-cell.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/src/gui/views/gcal-month-cell.c b/src/gui/views/gcal-month-cell.c index 3e07e2ee..67065e00 100644 --- a/src/gui/views/gcal-month-cell.c +++ b/src/gui/views/gcal-month-cell.c @@ -592,40 +592,20 @@ gcal_month_cell_set_overflow (GcalMonthCell *self, gint gcal_month_cell_get_content_space (GcalMonthCell *self) { - GtkStyleContext *context; - GtkBorder padding; - GtkBorder border; - g_return_val_if_fail (GCAL_IS_MONTH_CELL (self), -1); - context = gtk_widget_get_style_context (GTK_WIDGET (self)); - gtk_style_context_get_padding (context, &padding); - gtk_style_context_get_border (context, &border); - return gtk_widget_get_height (GTK_WIDGET (self)) - - gcal_month_cell_get_header_height (self) - - padding.top - padding.bottom - - border.top - border.bottom; + gcal_month_cell_get_header_height (self); } gint gcal_month_cell_get_header_height (GcalMonthCell *self) { - GtkStyleContext *context; - GtkBorder padding; - GtkBorder border; - g_return_val_if_fail (GCAL_IS_MONTH_CELL (self), -1); - context = gtk_widget_get_style_context (GTK_WIDGET (self->header_box)); - gtk_style_context_get_padding (context, &padding); - gtk_style_context_get_border (context, &border); - return gtk_widget_get_height (self->header_box) + gtk_widget_get_margin_top (self->header_box) + - gtk_widget_get_margin_bottom (self->header_box) + - padding.top + padding.bottom + - border.top + border.bottom; + gtk_widget_get_margin_bottom (self->header_box); } gint