SplitLayout: Fix #12261.
- SetItemCollapsed()/IsItemCollapsed() didn't properly handle inverting values when mapping between the collapsed flag and the layout item's internal visibility flag, leading to them having the opposite semantics from what their name would suggest.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright 2006-2009, Ingo Weinhold <[email protected]>.
|
||||
* Copyright 2015, Rene Gollent, [email protected].
|
||||
* All rights reserved. Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
@@ -493,14 +494,14 @@ BSplitLayout::SetCollapsible(int32 first, int32 last, bool collapsible)
|
||||
bool
|
||||
BSplitLayout::IsItemCollapsed(int32 index) const
|
||||
{
|
||||
return _ItemLayoutInfo(ItemAt(index))->isVisible;
|
||||
return !_ItemLayoutInfo(ItemAt(index))->isVisible;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BSplitLayout::SetItemCollapsed(int32 index, bool collapsed)
|
||||
{
|
||||
ItemAt(index)->SetVisible(collapsed);
|
||||
ItemAt(index)->SetVisible(!collapsed);
|
||||
|
||||
InvalidateLayout(true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user