From df7216f2f516b20207127d42212271c25717ebcb Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Tue, 1 May 2018 20:29:57 -0300 Subject: [PATCH] month-popover: don't be so small This commit limits the month popover at least 250px wide. To make it actually usable. --- src/views/gcal-month-popover.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/views/gcal-month-popover.c b/src/views/gcal-month-popover.c index 6a99a28f..c21f17a4 100644 --- a/src/views/gcal-month-popover.c +++ b/src/views/gcal-month-popover.c @@ -26,6 +26,7 @@ #include #define RATIO_TO_RELATIVE 1.25 +#define MIN_WIDTH 250 struct _GcalMonthPopover { @@ -275,6 +276,8 @@ reposition_popover (GcalMonthPopover *self, gtk_window_move (GTK_WINDOW (self), alloc.x - diff_w / 2, alloc.y - diff_h / 2); + alloc.width = MAX (MIN_WIDTH, alloc.width); + if (animate) { gtk_widget_set_size_request (GTK_WIDGET (self), alloc.width, alloc.height); @@ -853,6 +856,8 @@ gcal_month_popover_popdown (GcalMonthPopover *self) gtk_widget_get_toplevel (self->relative_to), 0, 0, &alloc.x, &alloc.y); adjust_margin (self, &alloc); + alloc.width = MAX (MIN_WIDTH, alloc.width); + animate_opacity (self, 0.0); animate_position (self, 0.0, 0.0); animate_size (self, alloc.width, alloc.height);