month-popover: don't be so small
This commit limits the month popover at least 250px wide. To make it actually usable.
This commit is contained in:
@@ -26,6 +26,7 @@
|
|||||||
#include <dazzle.h>
|
#include <dazzle.h>
|
||||||
|
|
||||||
#define RATIO_TO_RELATIVE 1.25
|
#define RATIO_TO_RELATIVE 1.25
|
||||||
|
#define MIN_WIDTH 250
|
||||||
|
|
||||||
struct _GcalMonthPopover
|
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);
|
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)
|
if (animate)
|
||||||
{
|
{
|
||||||
gtk_widget_set_size_request (GTK_WIDGET (self), alloc.width, alloc.height);
|
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);
|
gtk_widget_get_toplevel (self->relative_to), 0, 0, &alloc.x, &alloc.y);
|
||||||
adjust_margin (self, &alloc);
|
adjust_margin (self, &alloc);
|
||||||
|
|
||||||
|
alloc.width = MAX (MIN_WIDTH, alloc.width);
|
||||||
|
|
||||||
animate_opacity (self, 0.0);
|
animate_opacity (self, 0.0);
|
||||||
animate_position (self, 0.0, 0.0);
|
animate_position (self, 0.0, 0.0);
|
||||||
animate_size (self, alloc.width, alloc.height);
|
animate_size (self, alloc.width, alloc.height);
|
||||||
|
|||||||
Reference in New Issue
Block a user