scrolledwindow: Always add other scrollbar size...

... if we're not using indicators and the policy may be visible. Not
doing this if the policy may be invisible is incorrect as we need to
reserve the space anyway in case the scrolledwindow is allocated at
minimum size and the child size increases to show the scrollbar.
This commit is contained in:
Timm Bäder
2021-04-19 14:42:29 -04:00
committed by Matthias Clasen
parent 610f52b125
commit 25879ea37e
2 changed files with 26 additions and 8 deletions

View File

@ -58,7 +58,7 @@ test_size (gboolean overlay,
/* If the relevant scrollbar is non-overlay and always shown, it is added
* to the preferred size. When comparing to the expected size, we need to
* to exclude that extra, as we are only interested in the content size */
if (!overlay && policy == GTK_POLICY_ALWAYS)
if (!overlay)
{
GtkWidget *scrollbar = gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (scrolledwindow));
gtk_widget_get_preferred_width (scrollbar, &scrollbar_size, NULL);
@ -87,7 +87,7 @@ test_size (gboolean overlay,
gtk_widget_get_preferred_height (box, &child_size, NULL);
}
if (!overlay && policy == GTK_POLICY_ALWAYS)
if (!overlay)
{
GtkWidget *scrollbar = gtk_scrolled_window_get_hscrollbar (GTK_SCROLLED_WINDOW (scrolledwindow));
gtk_widget_get_preferred_height (scrollbar, &scrollbar_size, NULL);