Commit a694b7bd authored by Carlos Soriano's avatar Carlos Soriano

container-max-width: Warn in case minimum with > max width

Since the container is intended to have a max width, it's a requirement
that the child of the container request a lower minimum size than the
set maximum width, otherwise underallocation happen and there are visual

To catch errors in this code, make sure to warn in case the invariant
parent 2f3b535f
......@@ -108,6 +108,11 @@ get_preferred_width (GtkWidget *widget,
*minimum_size = 0;
gtk_widget_get_preferred_width (child, minimum_size, natural_size);
if (self->max_width != -1 && *minimum_size > self->max_width)
g_critical ("NautilusContainerMaxWidth's child requested %d while set maximum width is %d",
*minimum_size, self->max_width);
*natural_size = self->max_width == -1 ? *natural_size :
MAX (*minimum_size, MIN (self->max_width, *natural_size));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment