Adjust BCheckBox::MaxSize.

Previously BCheckBox returned unlimited width for its max size. This
became problematic if one wanted to put a checkbox in any kind of
horizontal layout with other controls, since they would expand to use as
much space as possible. This is also in contrast to other controls such
as BButton, which simply return the max to be the same as the preferred.
As such, adjust BCheckBox to do the same.
This commit is contained in:
Rene Gollent 2013-06-27 21:43:14 -04:00
parent fe448830c9
commit 7910d8b89c

View File

@ -366,7 +366,7 @@ BCheckBox::MouseDown(BPoint point)
Invalidate();
Window()->UpdateIfNeeded();
}
}
}
}
@ -452,7 +452,7 @@ BSize
BCheckBox::MaxSize()
{
return BLayoutUtils::ComposeSize(ExplicitMaxSize(),
BSize(B_SIZE_UNLIMITED, _ValidatePreferredSize().height));
_ValidatePreferredSize());
}
@ -631,6 +631,6 @@ B_IF_GCC_2(InvalidateLayout__9BCheckBoxb, _ZN9BCheckBox16InvalidateLayoutEb)(
perform_data_layout_invalidated data;
data.descendants = descendants;
box->Perform(PERFORM_CODE_LAYOUT_INVALIDATED, &data);
box->Perform(PERFORM_CODE_LAYOUT_INVALIDATED, &data);
}