mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-11 03:10:09 +00:00
scrolled window: Fix size requisition with overlay scrolling
When the scrollbars are overlayed, the size requisition of the scrolled window should not depend on whether the scrollbars are visible or not. This was not quite the case, because we forgot one case where scrollbar size was still added to the requisition.
This commit is contained in:
parent
cbf5b49cb8
commit
6e7ad732fc
@ -3537,15 +3537,13 @@ gtk_scrolled_window_get_preferred_size (GtkWidget *widget,
|
||||
}
|
||||
else
|
||||
{
|
||||
gint min_content_width = priv->min_content_width;
|
||||
|
||||
if (min_content_width >= 0)
|
||||
if (priv->min_content_width >= 0)
|
||||
{
|
||||
minimum_req.width = MAX (minimum_req.width, min_content_width);
|
||||
natural_req.width = MAX (natural_req.width, min_content_width);
|
||||
minimum_req.width = MAX (minimum_req.width, priv->min_content_width);
|
||||
natural_req.width = MAX (natural_req.width, priv->min_content_width);
|
||||
extra_width = -1;
|
||||
}
|
||||
else if (policy_may_be_visible (priv->vscrollbar_policy))
|
||||
else if (policy_may_be_visible (priv->vscrollbar_policy) && !priv->use_indicators)
|
||||
{
|
||||
minimum_req.width += vscrollbar_requisition.width;
|
||||
natural_req.width += vscrollbar_requisition.width;
|
||||
@ -3565,15 +3563,13 @@ gtk_scrolled_window_get_preferred_size (GtkWidget *widget,
|
||||
}
|
||||
else
|
||||
{
|
||||
gint min_content_height = priv->min_content_height;
|
||||
|
||||
if (min_content_height >= 0)
|
||||
if (priv->min_content_height >= 0)
|
||||
{
|
||||
minimum_req.height = MAX (minimum_req.height, min_content_height);
|
||||
natural_req.height = MAX (natural_req.height, min_content_height);
|
||||
minimum_req.height = MAX (minimum_req.height, priv->min_content_height);
|
||||
natural_req.height = MAX (natural_req.height, priv->min_content_height);
|
||||
extra_height = -1;
|
||||
}
|
||||
else if (policy_may_be_visible (priv->vscrollbar_policy))
|
||||
else if (policy_may_be_visible (priv->vscrollbar_policy) && !priv->use_indicators)
|
||||
{
|
||||
minimum_req.height += vscrollbar_requisition.height;
|
||||
natural_req.height += vscrollbar_requisition.height;
|
||||
|
Loading…
Reference in New Issue
Block a user