From c944d11f7e0a6775ab04ced50dd929e539c7d10f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Tue, 13 Apr 2010 13:36:49 +0000 Subject: [PATCH] bonefish+stippi: All views which cache layout information need to call ResetLayoutInvalidation() when they have updated the cached information. Otherwise calling InvalidateLayout() once they are already attached to a layout may not have any effect. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36217 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/interface/Box.cpp | 1 + src/kits/interface/CheckBox.cpp | 2 ++ src/kits/interface/Menu.cpp | 1 + src/kits/interface/MenuField.cpp | 1 + src/kits/interface/Slider.cpp | 2 ++ src/kits/interface/StringView.cpp | 2 ++ src/kits/interface/TextControl.cpp | 1 + src/kits/interface/TextView.cpp | 3 ++- 8 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/kits/interface/Box.cpp b/src/kits/interface/Box.cpp index da06a6f130..d47e6f8dd0 100644 --- a/src/kits/interface/Box.cpp +++ b/src/kits/interface/Box.cpp @@ -871,5 +871,6 @@ BBox::_ValidateLayoutData() } fLayoutData->valid = true; + ResetLayoutInvalidation(); } diff --git a/src/kits/interface/CheckBox.cpp b/src/kits/interface/CheckBox.cpp index 2896a2f523..4bf81fd5ec 100644 --- a/src/kits/interface/CheckBox.cpp +++ b/src/kits/interface/CheckBox.cpp @@ -611,6 +611,8 @@ BCheckBox::_ValidatePreferredSize() fPreferredSize.height = (float)ceil(6.0f + fontHeight.ascent + fontHeight.descent); + + ResetLayoutInvalidation(); } return fPreferredSize; diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp index 3677c33c51..2eeea849e9 100644 --- a/src/kits/interface/Menu.cpp +++ b/src/kits/interface/Menu.cpp @@ -2034,6 +2034,7 @@ BMenu::_ValidatePreferredSize() if (!fLayoutData->preferred.IsWidthSet() || ResizingMode() != fLayoutData->lastResizingMode) { _ComputeLayout(0, true, false, NULL, NULL); + ResetLayoutInvalidation(); } return fLayoutData->preferred; diff --git a/src/kits/interface/MenuField.cpp b/src/kits/interface/MenuField.cpp index c485e96ae9..dffbb17002 100644 --- a/src/kits/interface/MenuField.cpp +++ b/src/kits/interface/MenuField.cpp @@ -1113,6 +1113,7 @@ BMenuField::_ValidateLayoutData() fLayoutData->min = min; fLayoutData->valid = true; + ResetLayoutInvalidation(); TRACE("width: %.2f, height: %.2f\n", min.width, min.height); } diff --git a/src/kits/interface/Slider.cpp b/src/kits/interface/Slider.cpp index 43a4acf9de..536397154a 100644 --- a/src/kits/interface/Slider.cpp +++ b/src/kits/interface/Slider.cpp @@ -2146,6 +2146,8 @@ BSlider::_ValidateMinSize() fMinSize.width = width; fMinSize.height = height; + ResetLayoutInvalidation(); + return fMinSize; } diff --git a/src/kits/interface/StringView.cpp b/src/kits/interface/StringView.cpp index 1f8b629f45..1bf2c503c9 100644 --- a/src/kits/interface/StringView.cpp +++ b/src/kits/interface/StringView.cpp @@ -438,6 +438,8 @@ BStringView::_ValidatePreferredSize() fPreferredSize.height = ceilf(fontHeight.ascent + fontHeight.descent + fontHeight.leading); + + ResetLayoutInvalidation(); } return fPreferredSize; diff --git a/src/kits/interface/TextControl.cpp b/src/kits/interface/TextControl.cpp index 2eb28498ce..8dc79efd6e 100644 --- a/src/kits/interface/TextControl.cpp +++ b/src/kits/interface/TextControl.cpp @@ -1115,6 +1115,7 @@ BTextControl::_ValidateLayoutData() fLayoutData->min = min; fLayoutData->valid = true; + ResetLayoutInvalidation(); TRACE("width: %.2f, height: %.2f\n", min.width, min.height); } diff --git a/src/kits/interface/TextView.cpp b/src/kits/interface/TextView.cpp index 9bfc67f486..2750541100 100644 --- a/src/kits/interface/TextView.cpp +++ b/src/kits/interface/TextView.cpp @@ -1095,7 +1095,7 @@ BTextView::Perform(perform_code code, void* _data) BTextView::GetHeightForWidth(data->width, &data->min, &data->max, &data->preferred); return B_OK; -} + } case PERFORM_CODE_SET_LAYOUT: { perform_data_set_layout* data = (perform_data_set_layout*)_data; @@ -2823,6 +2823,7 @@ BTextView::_ValidateLayoutData() } fLayoutData->valid = true; + ResetLayoutInvalidation(); TRACE("width: %.2f, height: %.2f\n", min.width, min.height); }