week-grid: enforce a minimum width
https://bugzilla.gnome.org/show_bug.cgi?id=777414
This commit is contained in:
@@ -677,6 +677,7 @@ gcal_week_grid_size_allocate (GtkWidget *widget,
|
|||||||
guint64 events_at_range;
|
guint64 events_at_range;
|
||||||
gint natural_height;
|
gint natural_height;
|
||||||
gint widget_index;
|
gint widget_index;
|
||||||
|
gint min_width;
|
||||||
gint offset;
|
gint offset;
|
||||||
gint height;
|
gint height;
|
||||||
gint width;
|
gint width;
|
||||||
@@ -692,6 +693,7 @@ gcal_week_grid_size_allocate (GtkWidget *widget,
|
|||||||
widget_index = get_event_index (overlaps, data->start, data->end);
|
widget_index = get_event_index (overlaps, data->start, data->end);
|
||||||
|
|
||||||
/* Gtk complains about that */
|
/* Gtk complains about that */
|
||||||
|
gtk_widget_get_preferred_width (event_widget, &min_width, NULL);
|
||||||
gtk_widget_get_preferred_height (event_widget, NULL, &natural_height);
|
gtk_widget_get_preferred_height (event_widget, NULL, &natural_height);
|
||||||
|
|
||||||
/* Consider the margins of the child */
|
/* Consider the margins of the child */
|
||||||
@@ -711,7 +713,7 @@ gcal_week_grid_size_allocate (GtkWidget *widget,
|
|||||||
/* Setup the child position and size */
|
/* Setup the child position and size */
|
||||||
child_allocation.x = x;
|
child_allocation.x = x;
|
||||||
child_allocation.y = (data->start % MINUTES_PER_DAY) * minutes_height + margin.top;
|
child_allocation.y = (data->start % MINUTES_PER_DAY) * minutes_height + margin.top;
|
||||||
child_allocation.width = width;
|
child_allocation.width = MAX (width, min_width);
|
||||||
child_allocation.height = height;
|
child_allocation.height = height;
|
||||||
|
|
||||||
gtk_widget_size_allocate (event_widget, &child_allocation);
|
gtk_widget_size_allocate (event_widget, &child_allocation);
|
||||||
|
|||||||
Reference in New Issue
Block a user