Don't show empty sizers.
Revert the change of r44514 and do hide the empty sizers. Code relying on them being shown/positioned should use wxRESERVE_SPACE_EVEN_IF_HIDDEN flag but assuming it by default results in completely unexpected layouts, e.g. still using margins around a sizer with hidden window if it contains an empty sub-sizer. Closes #11426. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65079 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
5bdeabafbe
commit
cbc751bc56
@ -585,20 +585,13 @@ bool wxSizerItem::IsShown() const
|
||||
// arbitrarily decide that if at least one of our elements is
|
||||
// shown, so are we (this arbitrariness is the reason for
|
||||
// deprecating this function)
|
||||
for ( wxSizerItemList::compatibility_iterator
|
||||
node = m_sizer->GetChildren().GetFirst();
|
||||
node;
|
||||
node = node->GetNext() )
|
||||
{
|
||||
// Some apps (such as dialog editors) depend on an empty sizer still
|
||||
// being laid out correctly and reporting the correct size and position.
|
||||
if (m_sizer->GetChildren().GetCount() == 0)
|
||||
if ( node->GetData()->IsShown() )
|
||||
return true;
|
||||
|
||||
for ( wxSizerItemList::compatibility_iterator
|
||||
node = m_sizer->GetChildren().GetFirst();
|
||||
node;
|
||||
node = node->GetNext() )
|
||||
{
|
||||
if ( node->GetData()->IsShown() )
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user