Merge "Use Actor target size for default layout." into devel/master
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Thu, 28 Jun 2018 16:33:58 +0000 (16:33 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Thu, 28 Jun 2018 16:33:59 +0000 (16:33 +0000)
1  2 
dali-toolkit/devel-api/layouting/layout-group-impl.cpp

@@@ -451,8 -451,7 +451,8 @@@ void LayoutGroup::ChildAddedToOwner( Ac
  {
    LayoutItemPtr childLayout;
    Toolkit::Control control = Toolkit::Control::DownCast( child );
 -  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "LayoutGroup::ChildAddedToOwner(%s)\n", control.GetName().c_str() );
 +
 +  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "LayoutGroup::ChildAddedToOwner control(%s)\n", control?control.GetName().c_str():"Invalid" );
  
    if( control ) // Can only support adding Controls, not Actors to layout
    {
  #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