From 7910d8b89cc2285eba6efc8c16475dd06617bc8b Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Thu, 27 Jun 2013 21:43:14 -0400 Subject: [PATCH] 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. --- src/kits/interface/CheckBox.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kits/interface/CheckBox.cpp b/src/kits/interface/CheckBox.cpp index cde4220fbd..ff06aaeae8 100644 --- a/src/kits/interface/CheckBox.cpp +++ b/src/kits/interface/CheckBox.cpp @@ -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); }