After the first call to BView::InvalidateLayout() further invocations don't

invoke the layout's InvalidateLayout() anymore. This could cause problems when
the layout caches layout related information and also updates those on calls
other than LayoutView(). A call to such a method after an InvalidateLayout()
would mark the cached info valid and the layout would use the cached info
until the first InvalidateLayout() after the next LayoutView(), even if
BView::InvalidateLayout() had been called again in the meantime.

* Introduced a new method BView::ResetLayoutInvalidation(), which must be
  called by layout implementations whenever they have updated their cached
  information and need further InvalidateLayout() notifications.
* Adjusted the existing layout implementations to use the method.

Fixes bug #4047.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31316 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2009-06-29 14:18:12 +00:00
parent 23eb9a9e82
commit a0747aad3b
5 changed files with 45 additions and 12 deletions
+4 -1
View File
@@ -1,5 +1,5 @@
/*
* Copyright 2006, Ingo Weinhold <[email protected].de>.
* Copyright 2006-2009, Ingo Weinhold <ingo_weinhold@gmx.de>.
* All rights reserved. Distributed under the terms of the MIT License.
*/
@@ -1147,6 +1147,9 @@ BSplitLayout::_ValidateMinMax()
fHorizontalLayoutInfo = fHorizontalLayouter->CreateLayoutInfo();
if (fHeightForWidthItems.IsEmpty())
fVerticalLayoutInfo = fVerticalLayouter->CreateLayoutInfo();
if (BView* view = View())
view->ResetLayoutInvalidation();
}
// _InternalGetHeightForWidth