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:
parent
fe448830c9
commit
7910d8b89c
@ -366,7 +366,7 @@ BCheckBox::MouseDown(BPoint point)
|
|||||||
Invalidate();
|
Invalidate();
|
||||||
Window()->UpdateIfNeeded();
|
Window()->UpdateIfNeeded();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -452,7 +452,7 @@ BSize
|
|||||||
BCheckBox::MaxSize()
|
BCheckBox::MaxSize()
|
||||||
{
|
{
|
||||||
return BLayoutUtils::ComposeSize(ExplicitMaxSize(),
|
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;
|
perform_data_layout_invalidated data;
|
||||||
data.descendants = descendants;
|
data.descendants = descendants;
|
||||||
|
|
||||||
box->Perform(PERFORM_CODE_LAYOUT_INVALIDATED, &data);
|
box->Perform(PERFORM_CODE_LAYOUT_INVALIDATED, &data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user