diff --git a/src/gui/views/gcal-month-cell.blp b/src/gui/views/gcal-month-cell.blp index 5ccc4c94..8b05541c 100644 --- a/src/gui/views/gcal-month-cell.blp +++ b/src/gui/views/gcal-month-cell.blp @@ -29,66 +29,70 @@ template $GcalMonthCell: Widget { child: Overlay overlay { [overlay] - Box header_box { + Adw.Bin { valign: start; - spacing: 6; - margin-top: 6; - margin-bottom: 6; - margin-start: 6; - margin-end: 6; - Label day_label { - styles [ - "day-label", - "numeric", - ] - } + child: Box header_box { + spacing: 6; + margin-top: 6; + margin-bottom: 6; + margin-start: 6; + margin-end: 6; - Image weather_icon { - pixel-size: 16; - margin-start: 12; - accessible-role: presentation; + Label day_label { + styles [ + "day-label", + "numeric", + ] + } - styles [ - "dimmed", - ] - } + Image weather_icon { + pixel-size: 16; + margin-start: 12; + accessible-role: presentation; - Label temp_label { - styles [ - "dimmed", - "temp-label", - ] - } + styles [ + "dimmed", + ] + } + + Label temp_label { + styles [ + "dimmed", + "temp-label", + ] + } + }; } [overlay] - Button overflow_button { - accessible-role: toggle_button; + Adw.Bin { valign: end; - sensitive: false; - clicked => $overflow_button_clicked_cb(template) not-swapped; - tooltip-text: _("All Events"); - margin-top: 1; - margin-start: 1; - margin-bottom: 2; - margin-end: 2; - accessibility { - has-popup: true; - labelled-by: overflow_inscription; - } + child: Button overflow_button { + accessible-role: toggle_button; + sensitive: false; + clicked => $overflow_button_clicked_cb(template) not-swapped; + tooltip-text: _("All Events"); + margin-top: 1; + margin-start: 1; + margin-bottom: 2; + margin-end: 2; - styles [ - "flat", - "overflow", - ] - - Box { - Inscription overflow_inscription { - text-overflow: ellipsize_end; + accessibility { + has-popup: true; + labelled-by: overflow_inscription; } - } + + styles [ + "flat", + "overflow", + ] + + child: Inscription overflow_inscription { + text-overflow: ellipsize_end; + }; + }; } }; } diff --git a/src/gui/views/gcal-month-cell.c b/src/gui/views/gcal-month-cell.c index 3588589b..0771740c 100644 --- a/src/gui/views/gcal-month-cell.c +++ b/src/gui/views/gcal-month-cell.c @@ -70,6 +70,17 @@ static guint signals[N_SIGNALS] = { 0, }; * Auxiliary methods */ +static inline gint +get_parent_bin_height (GtkWidget *widget) +{ + GtkWidget *parent; + + parent = gtk_widget_get_parent (widget); + g_assert (ADW_IS_BIN (parent)); + + return gtk_widget_get_height (parent); +} + static void update_style_flags (GcalMonthCell *self) { @@ -568,9 +579,7 @@ gcal_month_cell_get_header_height (GcalMonthCell *self) { g_return_val_if_fail (GCAL_IS_MONTH_CELL (self), -1); - return gtk_widget_get_height (self->header_box) + - gtk_widget_get_margin_top (self->header_box) + - gtk_widget_get_margin_bottom (self->header_box); + return get_parent_bin_height (self->header_box); } gint @@ -578,7 +587,7 @@ gcal_month_cell_get_overflow_height (GcalMonthCell *self) { g_return_val_if_fail (GCAL_IS_MONTH_CELL (self), -1); - return gtk_widget_get_height (self->overflow_button); + return get_parent_bin_height (self->overflow_button); } gboolean