Use Actor target size for default layout.
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / layouting / layout-group-impl.cpp
index 18dd1d6..67a673c 100644 (file)
@@ -470,6 +470,18 @@ void LayoutGroup::ChildAddedToOwner( Actor child )
 #endif
       childControlDataImpl.SetLayout( *childLayout.Get() );
 
+      Vector3 size = child.GetTargetSize();
+      // If the size of the control is set explicitly make sure that the control size
+      // stays the same after the layout except it is over written with match parent specs.
+      if ( size.x != 0 )
+      {
+        childLayout->SetMinimumWidth( size.x );
+      }
+
+      if ( size.y != 0 )
+      {
+        childLayout->SetMinimumHeight( size.y );
+      }
       // Default layout data will be generated by Add().
     }
     else