// Take ownership of existing children
for( unsigned int childIndex = 0 ; childIndex < control.GetChildCount(); ++childIndex )
{
- ChildAddedToOwner( control.GetChildAt( childIndex ) );
+ ChildAddedToOwnerImpl( control.GetChildAt( childIndex ) );
}
DevelActor::ChildAddedSignal( control ).Connect( mSlotDelegate, &LayoutGroup::ChildAddedToOwner );
}
}
}
+
+ RequestLayout( Dali::Toolkit::LayoutTransitionData::LayoutTransitionType::ON_OWNER_SET );
}
}
{
// Remove children
RemoveAll();
+
+ auto control = Toolkit::Control::DownCast( GetOwner() );
+ if( control )
+ {
+ DevelActor::ChildAddedSignal( control ).Disconnect( mSlotDelegate, &LayoutGroup::ChildAddedToOwner );
+ DevelActor::ChildRemovedSignal( control ).Disconnect( mSlotDelegate, &LayoutGroup::ChildRemovedFromOwner );
+ DevelActor::ChildOrderChangedSignal( control ).Disconnect( mSlotDelegate, &LayoutGroup::ChildOrderChanged );
+ DevelHandle::PropertySetSignal( control ).Disconnect( mSlotDelegate, &LayoutGroup::OnOwnerPropertySet );
+ }
}
void LayoutGroup::RemoveChild( LayoutItem& item )
void LayoutGroup::ChildAddedToOwner( Actor child )
{
+ ChildAddedToOwnerImpl( child );
+ RequestLayout( Dali::Toolkit::LayoutTransitionData::LayoutTransitionType::ON_CHILD_ADD );
+}
+
+void LayoutGroup::ChildAddedToOwnerImpl( Actor child )
+{
LayoutItemPtr childLayout;
Toolkit::Control control = Toolkit::Control::DownCast( child );
if( childLayout )
{
Remove( *childLayout.Get() );
+ RequestLayout( Dali::Toolkit::LayoutTransitionData::LayoutTransitionType::ON_CHILD_REMOVE );
}
}
}
bool exactWidth ( false );
bool exactHeight ( false );
- // Default Layouting behaviour if not overridden
+ // Layouting behaviour
// EXACT, width and height as provided.
- // MATCH_PARENT, width and hewidthSpecSizeight that of parent
-
+ // MATCH_PARENT, width and height that of parent
// WRAP_CONTENT, take width of widest child and height size of longest child (within given limit)
// UNSPECIFIED, take width of widest child and height size of longest child.