Skip to content

Commit

Permalink
SplitLayout: Fix #12261.
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
anevilyak committed Jul 31, 2015
1 parent 6306a26 commit 3333f96
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/kits/interface/SplitLayout.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright 2006-2009, Ingo Weinhold <ingo_weinhold@gmx.de>.
* Copyright 2015, Rene Gollent, rene@gollent.com.
* All rights reserved. Distributed under the terms of the MIT License.
*/

Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 3333f96

Please sign in to comment.