API for Control to set LayoutRequired flag 06/188406/7
authoragnelo vaz <agnelo.vaz@samsung.com>
Tue, 4 Sep 2018 18:13:48 +0000 (19:13 +0100)
committerAgnelo Vaz <agnelo.vaz@samsung.com>
Mon, 10 Sep 2018 09:43:18 +0000 (10:43 +0100)
Control behaviour can be set to need a layout and use
the Layout system or not and use the legacy size negotiation.

Change-Id: I90848cc238d8857d9ea380d9a6d5f6d82a431085

automated-tests/src/dali-toolkit/utc-Dali-Layouting.cpp
dali-toolkit/devel-api/controls/control-devel.cpp
dali-toolkit/devel-api/controls/control-devel.h
dali-toolkit/devel-api/layouting/layout-group-impl.cpp
dali-toolkit/devel-api/layouting/layout-item-impl.cpp
dali-toolkit/internal/controls/control/control-data-impl.cpp
dali-toolkit/internal/controls/control/control-data-impl.h
dali-toolkit/internal/layouting/absolute-layout-impl.cpp
dali-toolkit/internal/layouting/layout-controller-impl.cpp

index 28ada5a..6e8cc16 100644 (file)
@@ -2788,19 +2788,21 @@ int UtcDaliLayouting_LayoutGroup01(void)
   DevelControl::SetLayout( hbox, hboxLayout );
   hbox.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION, 600 );
   hbox.SetProperty( LayoutItem::ChildProperty::HEIGHT_SPECIFICATION,  ChildLayoutData::WRAP_CONTENT );
+  DevelControl::SetLayoutingRequired( hbox, true );
   hbox.SetAnchorPoint( AnchorPoint::TOP_LEFT );  // LinearLayout will eventually do this internally.
 
-  tet_infoline("Add a control without SetLayout being called");
+  tet_infoline("Add a control without SetLayout being called but with layout required set true");
 
   auto control = Control::New();
   control.SetName("Control1");
+  DevelControl::SetLayoutingRequired( control, true );
   hbox.Add( control );
   control.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
   control.SetProperty( LayoutItem::ChildProperty::HEIGHT_SPECIFICATION,  ChildLayoutData::WRAP_CONTENT );
-
   tet_infoline("Add a Textlabel to the control");
   auto textLabel = TextLabel::New("Test text");
   textLabel.SetName("TextLabel");
+
   control.Add( textLabel );
 
   // Ensure layouting happens
@@ -2826,17 +2828,18 @@ int UtcDaliLayouting_LayoutGroup02(void)
   // Create a parent layout
   auto hbox = Control::New();
   auto hboxLayout = LinearLayout::New();
+  DevelControl::SetLayout( hbox, hboxLayout );
   hbox.SetName( "HBox");
   rootControl.Add( hbox );
-  DevelControl::SetLayout( hbox, hboxLayout );
   hbox.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION, 600 );
   hbox.SetProperty( LayoutItem::ChildProperty::HEIGHT_SPECIFICATION,  ChildLayoutData::WRAP_CONTENT );
   hbox.SetAnchorPoint( AnchorPoint::TOP_LEFT );  // LinearLayout will eventually do this internally.
 
-  tet_infoline("Add a control without SetLayout being called");
+  tet_infoline("Add a control without SetLayout being called but with layout required set true");
 
   auto control = Control::New();
   control.SetName("Control1");
+  DevelControl::SetLayoutingRequired( control, true );
   hbox.Add( control );
   control.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
   control.SetProperty( LayoutItem::ChildProperty::HEIGHT_SPECIFICATION,  ChildLayoutData::WRAP_CONTENT );
@@ -2874,7 +2877,7 @@ int UtcDaliLayouting_LayoutGroup02(void)
 int UtcDaliLayouting_LayoutGroup03(void)
 {
   ToolkitTestApplication application;
-  tet_infoline("UtcDaliLayouting_LayoutGroup03 - Test control witha LayoutGroup as a leaf");
+  tet_infoline("UtcDaliLayouting_LayoutGroup03 - Test control with a LayoutGroup as a leaf");
 
   Control rootControl;
   SetupRootLayoutControl( rootControl );
@@ -2882,9 +2885,47 @@ int UtcDaliLayouting_LayoutGroup03(void)
   // Create a parent layout
   auto hbox = Control::New();
   auto hboxLayout = LinearLayout::New();
+  DevelControl::SetLayout( hbox, hboxLayout );
   hbox.SetName( "HBox");
   rootControl.Add( hbox );
+  hbox.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION, 600 );
+  hbox.SetProperty( LayoutItem::ChildProperty::HEIGHT_SPECIFICATION,  ChildLayoutData::WRAP_CONTENT );
+  hbox.SetAnchorPoint( AnchorPoint::TOP_LEFT );  // LinearLayout will eventually do this internally.
+
+  tet_infoline("Add a control without SetLayout being called");
+
+  auto control = Control::New();
+  control.SetName("Control1");
+  hbox.Add( control );
+  control.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
+  control.SetProperty( LayoutItem::ChildProperty::HEIGHT_SPECIFICATION,  100 );
+
+  // Ensure layouting happens
+  application.SendNotification();
+  application.Render();
+
+  tet_infoline("Test control is width of it's parent and exact given height");
+  DALI_TEST_EQUALS( control.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 600.0f, 100.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( control.GetProperty<Vector3>( Actor::Property::POSITION ), Vector3( 0.0f, 0.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+  END_TEST;
+}
+
+
+int UtcDaliLayouting_LayoutGroup04(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline("UtcDaliLayouting_LayoutGroup04 - Test control with a LayoutGroup as a leaf and with SetLayotRequired = true");
+
+  Control rootControl;
+  SetupRootLayoutControl( rootControl );
+
+  // Create a parent layout
+  auto hbox = Control::New();
+  auto hboxLayout = LinearLayout::New();
   DevelControl::SetLayout( hbox, hboxLayout );
+  hbox.SetName( "HBox");
+  rootControl.Add( hbox );
   hbox.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION, 600 );
   hbox.SetProperty( LayoutItem::ChildProperty::HEIGHT_SPECIFICATION,  ChildLayoutData::WRAP_CONTENT );
   hbox.SetAnchorPoint( AnchorPoint::TOP_LEFT );  // LinearLayout will eventually do this internally.
@@ -2893,6 +2934,7 @@ int UtcDaliLayouting_LayoutGroup03(void)
 
   auto control = Control::New();
   control.SetName("Control1");
+  DevelControl::SetLayoutingRequired( control, true );
   hbox.Add( control );
   control.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
   control.SetProperty( LayoutItem::ChildProperty::HEIGHT_SPECIFICATION,  100 );
@@ -2908,6 +2950,44 @@ int UtcDaliLayouting_LayoutGroup03(void)
   END_TEST;
 }
 
+int UtcDaliLayouting_IsLayoutingRequired(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline("UtcDaliLayouting_IsLayoutingRequired - Test setting the SetLayoutRequired and then check if flag was set");
+
+  Control rootControl;
+  SetupRootLayoutControl( rootControl );
+
+  // Create a parent layout
+  auto hbox = Control::New();
+  auto hboxLayout = LinearLayout::New();
+  DevelControl::SetLayout( hbox, hboxLayout );
+  hbox.SetName( "HBox");
+  rootControl.Add( hbox );
+  hbox.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION, 600 );
+  hbox.SetProperty( LayoutItem::ChildProperty::HEIGHT_SPECIFICATION,  ChildLayoutData::WRAP_CONTENT );
+  hbox.SetAnchorPoint( AnchorPoint::TOP_LEFT );  // LinearLayout will eventually do this internally.
+
+  tet_infoline("Add a control without SetLayout being called");
+
+  auto control = Control::New();
+  control.SetName("Control1");
+  DALI_TEST_EQUALS( DevelControl::IsLayoutingRequired( control ), false, TEST_LOCATION );
+  DevelControl::SetLayoutingRequired( control, true );
+  hbox.Add( control );
+  control.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::MATCH_PARENT );
+  control.SetProperty( LayoutItem::ChildProperty::HEIGHT_SPECIFICATION,  100 );
+
+  // Ensure layouting happens
+  application.SendNotification();
+  application.Render();
+
+  tet_infoline("Test control is width of it's parent and exact given height");
+  DALI_TEST_EQUALS( DevelControl::IsLayoutingRequired( control ), true, TEST_LOCATION );
+
+  END_TEST;
+}
+
 int UtcDaliLayouting_LayoutGroupWithPadding01(void)
 {
   ToolkitTestApplication application;
@@ -2930,6 +3010,7 @@ int UtcDaliLayouting_LayoutGroupWithPadding01(void)
 
   auto control = Control::New();
   control.SetName("Control1");
+  DevelControl::SetLayoutingRequired( control, true );
   hbox.Add( control );
   control.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
   control.SetProperty( LayoutItem::ChildProperty::HEIGHT_SPECIFICATION,  ChildLayoutData::WRAP_CONTENT );
@@ -2977,6 +3058,7 @@ int UtcDaliLayouting_LayoutGroupWithChildMargin01(void)
 
   auto control = Control::New();
   control.SetName("Control1");
+  DevelControl::SetLayoutingRequired( control, true );
   hbox.Add( control );
   control.SetProperty( LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
   control.SetProperty( LayoutItem::ChildProperty::HEIGHT_SPECIFICATION,  ChildLayoutData::WRAP_CONTENT );
index 01f240f..c17b944 100755 (executable)
@@ -152,6 +152,19 @@ void RequestLayout( Internal::Control& control )
     layoutItem->RequestLayout();
   }
 }
+void SetLayoutingRequired( Control control, bool layoutingRequired )
+{
+  Internal::Control& internalControl = Toolkit::Internal::GetImplementation( control );
+  Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( internalControl );
+  controlDataImpl.SetLayoutingRequired( layoutingRequired );
+}
+
+bool IsLayoutingRequired( Control control )
+{
+  Internal::Control& internalControl = Toolkit::Internal::GetImplementation( control );
+  Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( internalControl );
+  return controlDataImpl.IsLayoutingRequired();
+}
 
 } // namespace DevelControl
 
index 879c767..e2fcc86 100755 (executable)
@@ -307,6 +307,20 @@ DALI_TOOLKIT_API void SetLayout( Control control, Toolkit::LayoutItem layout );
  */
 DALI_TOOLKIT_API void RequestLayout( Internal::Control& control );
 
+/**
+ * @brief Set whether the control should have a layout
+ * @param[in] control The Control to set the behaviour on
+ * @param[in] layoutingRequired true if the control should have a layout
+ */
+DALI_TOOLKIT_API void SetLayoutingRequired( Control control, bool layoutingRequired );
+
+/**
+ * @brief Check if the control has been set to require layouting
+ * @param[in] control The Control to query
+ * @return true if the control needs layouting
+ */
+DALI_TOOLKIT_API bool IsLayoutingRequired( Control control );
+
 } // namespace DevelControl
 
 } // namespace Toolkit
index 9f54f56..8cdd8bc 100644 (file)
@@ -588,13 +588,25 @@ void LayoutGroup::ChildAddedToOwner( Actor child )
 
     if( ! childLayout )
     {
-      // If the child doesn't already have a layout, then create a LayoutItem for it.
-      childLayout = LayoutGroup::New( control );
+      // If the child doesn't already have a layout, then create a LayoutItem or LayoutGroup for it.
+      // If control behaviour flag set to Layout then set a LayoutGroup.
+      if( DevelControl::IsLayoutingRequired( control ) )
+      {
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "LayoutGroup::ChildAddedToOwner Creating default LayoutGroup for control:%s\n", control?control.GetName().c_str():"Invalid" );
+        childLayout = LayoutGroup::New( control );
+      }
+      else
+      {
+        DALI_LOG_INFO( gLogFilter, Debug::Verbose, "LayoutGroup::ChildAddedToOwner Creating default LayoutItem for control:%s\n", control?control.GetName().c_str():"Invalid" );
+        childLayout = LayoutItem::New( control );
+      }
       childLayout->SetAnimateLayout( IsLayoutAnimated() ); // @todo this essentially forces animation inheritance. Bad?
-#if defined(DEBUG_ENABLED)
-      auto desiredSize = control.GetNaturalSize();
-      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "LayoutGroup::ChildAddedToOwner desiredSize(%f,%f) (naturalSize)\n", desiredSize.width, desiredSize.height );
-#endif
+
+      DALI_LOG_STREAM( gLogFilter, Debug::Verbose, "LayoutGroup::ChildAddedToOwner control:" <<  control.GetName().c_str() <<
+                       " desiredWidth: " <<  control.GetNaturalSize().width <<
+                       " desiredHeight:"  << control.GetNaturalSize().height
+                       );
+
       childControlDataImpl.SetLayout( *childLayout.Get() );
 
       Vector3 size = child.GetTargetSize();
@@ -698,7 +710,7 @@ void LayoutGroup::OnAnimationStateChanged( bool animateLayout )
   for( auto&& child : mImpl->mChildren )
   {
     LayoutGroupPtr parentGroup( dynamic_cast< LayoutGroup* >( child.child.Get() ) );
-    if( parentGroup && ( 0 == parentGroup->GetChildCount() ) ) // A leaf LayoutGroup will have no children.
+    if( ! parentGroup )
     {
       // Change state only in case of leaf children
       child.child->SetAnimateLayout( animateLayout );
@@ -708,14 +720,14 @@ void LayoutGroup::OnAnimationStateChanged( bool animateLayout )
 
 void LayoutGroup::OnMeasure( MeasureSpec widthMeasureSpec, MeasureSpec heightMeasureSpec )
 {
+  auto childCount = GetChildCount();
+
   DALI_LOG_STREAM( gLogFilter, Debug::Verbose,
                   "LayoutGroup::OnMeasure Actor Id:" <<  Actor::DownCast(GetOwner()).GetId() <<
                   " Owner:" <<  Actor::DownCast(GetOwner()).GetName() <<
+                  " Child Count:" << childCount <<
                   " MeasureSpecs( width:"<<widthMeasureSpec<<", height:"<<heightMeasureSpec );
 
-  auto childCount = GetChildCount();
-  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "LayoutGroup::OnMeasure child count(%u)\n", childCount);
-
   auto widthMode = widthMeasureSpec.GetMode();
   auto heightMode = heightMeasureSpec.GetMode();
   LayoutLength widthSpecSize = widthMeasureSpec.GetSize();
@@ -755,6 +767,10 @@ void LayoutGroup::OnMeasure( MeasureSpec widthMeasureSpec, MeasureSpec heightMea
         layoutHeight = std::max( layoutHeight, childHeight + childMargin.top + childMargin.bottom );
         DALI_LOG_INFO( gLogFilter, Debug::Verbose, "LayoutGroup::OnMeasure calculated child width[%d] calculated height(%d)\n", layoutWidth.mValue, layoutHeight.mValue );
       }
+      else
+      {
+          DALI_LOG_INFO( gLogFilter, Debug::Verbose, "LayoutGroup::OnMeasure Not a layout\n" );
+      }
     }
 
     Extents padding = GetPadding();
@@ -802,16 +818,16 @@ void LayoutGroup::OnMeasure( MeasureSpec widthMeasureSpec, MeasureSpec heightMea
     layoutHeight = heightSpecSize;
   }
 
-  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "LayoutGroup::OnMeasure Measured size(%d,%d) for : %s \n", layoutWidth.mValue, layoutHeight.mValue, Actor::DownCast(GetOwner()).GetName().c_str() );
+  DALI_LOG_INFO( gLogFilter, Debug::General, "LayoutGroup::OnMeasure Measured size(%d,%d) for : %s \n", layoutWidth.mValue, layoutHeight.mValue, Actor::DownCast(GetOwner()).GetName().c_str() );
   SetMeasuredDimensions( MeasuredSize( layoutWidth ), MeasuredSize( layoutHeight ) );
 }
 
 void LayoutGroup::OnLayout( bool changed, LayoutLength left, LayoutLength top, LayoutLength right, LayoutLength bottom )
 {
-  DALI_LOG_INFO( gLogFilter, Debug::Verbose, "LayoutGroup::OnLayout\n");
-
   auto count = GetChildCount();
 
+  DALI_LOG_STREAM( gLogFilter, Debug::Verbose, "LayoutGroup OnLayout owner:" << ( ( Toolkit::Control::DownCast(GetOwner())) ? Toolkit::Control::DownCast(GetOwner()).GetName() : "invalid" )  << " childCount:" << count );
+
   for( unsigned int childIndex = 0; childIndex < count; childIndex++)
   {
     LayoutItemPtr childLayout = GetChildAt( childIndex );
@@ -825,12 +841,14 @@ void LayoutGroup::OnLayout( bool changed, LayoutLength left, LayoutLength top, L
       auto control = Toolkit::Control::DownCast( childOwner );
       Extents padding = GetPadding();
 
-      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "LayoutGroup::OnLayout child width[%d] height(%d)\n", childWidth.mValue, childHeight.mValue );
-
       auto childPosition = control.GetProperty< Vector3 >( Actor::Property::POSITION );
       auto anchorPoint = control.GetProperty< Vector3 >( Actor::Property::ANCHOR_POINT );
 
-      DALI_LOG_INFO( gLogFilter, Debug::Verbose, "LayoutGroup::OnLayout child[%s] position(%f,%f)\n", control.GetName().c_str(), childPosition.x, childPosition.y );
+      DALI_LOG_INFO( gLogFilter, Debug::General, "LayoutGroup::OnLayout child[%s] position(%f,%f) child width[%d] height(%d)\n",
+                      control.GetName().c_str(),
+                      childPosition.x, childPosition.y,
+                      childWidth.mValue, childHeight.mValue
+                      );
 
       // Margin and Padding only supported when child anchor point is TOP_LEFT.
       int paddingAndMarginOffsetX = ( AnchorPoint::TOP_LEFT == anchorPoint ) ? ( padding.top + childMargin.top ) : 0;
index 85fab8a..987b799 100644 (file)
@@ -95,15 +95,11 @@ void LayoutItem::Unparent()
 
 void LayoutItem::SetAnimateLayout( bool animateLayout )
 {
-  DALI_LOG_INFO( gLayoutFilter, Debug::Verbose, "LayoutItem::SetAnimateLayout animateLayout(%s)\n", (animateLayout)?"true":"false" );
-
   auto owner = GetOwner();
   auto actor = Actor::DownCast(owner);
 
-  if( actor )
-  {
-      DALI_LOG_INFO( gLayoutFilter, Debug::Verbose, "LayoutItem::SetAnimateLayout animateLayout(%s) owner(%s)\n", (animateLayout)?"true":"false", actor.GetName().c_str() );
-  }
+  DALI_LOG_INFO( gLayoutFilter, Debug::Verbose, "LayoutItem::SetAnimateLayout animateLayout(%s) owner(%s)\n", (animateLayout)?"true":"false",
+                 ( ( Actor::DownCast( owner) ) ? Actor::DownCast(owner).GetName().c_str() : "Invalid Actor" ) );
 
   mImpl->mAnimated = animateLayout;
 
@@ -163,7 +159,7 @@ void LayoutItem::Measure( MeasureSpec widthMeasureSpec, MeasureSpec heightMeasur
 
   const bool needsLayout = specChanged && ( !isSpecExactly || !matchesSpecSize );
 
-  DALI_LOG_STREAM( gLayoutFilter, Debug::Verbose, "LayoutItem::Measure("<<widthMeasureSpec<<", "<<heightMeasureSpec<<") Owner:"<<Actor::DownCast(GetOwner()).GetName() <<"  forceLayout="<<forceLayout<<", specChanged="<<specChanged<<", isSpecExactly="<<isSpecExactly<<", matchesSpecSize="<<matchesSpecSize<<", needsLayout="<<needsLayout <<std::endl <<(forceLayout||needsLayout?"  Remeasuring":"  NoChange"));
+  DALI_LOG_STREAM( gLayoutFilter, Debug::General, "LayoutItem::Measure("<<widthMeasureSpec<<", "<<heightMeasureSpec<<") Owner:"<<Actor::DownCast(GetOwner()).GetName() <<"  forceLayout="<<forceLayout<<", specChanged="<<specChanged<<", isSpecExactly="<<isSpecExactly<<", matchesSpecSize="<<matchesSpecSize<<", needsLayout="<<needsLayout <<std::endl <<(forceLayout||needsLayout?"  Remeasuring":"  NoChange"));
 
   if( forceLayout || needsLayout )
   {
@@ -173,14 +169,14 @@ void LayoutItem::Measure( MeasureSpec widthMeasureSpec, MeasureSpec heightMeasur
 #if defined(DEBUG_ENABLED)
     std::ostringstream o;
     o<<widthMeasureSpec<<","<<heightMeasureSpec;
-    DALI_LOG_INFO( gLayoutFilter, Debug::Concise, "LayoutItem::Measure Calling %s OnMeasure( %s )\n", Actor::DownCast(GetOwner()).GetName().c_str(), o.str().c_str());
+    DALI_LOG_INFO( gLayoutFilter, Debug::General, "LayoutItem::Measure Calling %s OnMeasure( %s )\n", Actor::DownCast(GetOwner()).GetName().c_str(), o.str().c_str());
 #endif
     OnMeasure( widthMeasureSpec, heightMeasureSpec );
     mImpl->ClearPrivateFlag( Impl::PRIVATE_FLAG_MEASURE_NEEDED_BEFORE_LAYOUT );
 
     // flag not set, setMeasuredDimension() was not invoked, we raise an exception to warn the developer
     DALI_ASSERT_ALWAYS( mImpl->GetPrivateFlag( Impl::PRIVATE_FLAG_MEASURED_DIMENSION_SET ) &&
-                        "Layout's OnMeasure() mension()" );
+                        "Layout's OnMeasure() Measured dimension flag not set" );
     mImpl->SetPrivateFlag( Impl::PRIVATE_FLAG_LAYOUT_REQUIRED );
   }
 
index cbeb4c5..12f09c8 100755 (executable)
@@ -36,6 +36,7 @@
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/controls/control-wrapper-impl.h>
+#include <dali-toolkit/devel-api/layouting/layout-item.h>
 #include <dali-toolkit/internal/styling/style-manager-impl.h>
 #include <dali-toolkit/internal/visuals/visual-string-constants.h>
 
@@ -339,7 +340,8 @@ Control::Impl::Impl( Control& controlImpl )
   mInputMethodContext(),
   mFlags( Control::ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) ),
   mIsKeyboardNavigationSupported( false ),
-  mIsKeyboardFocusGroup( false )
+  mIsKeyboardFocusGroup( false ),
+  mIsLayoutingRequired( false )
 {
 }
 
@@ -1457,6 +1459,16 @@ void Control::Impl::RemoveLayout()
   }
 }
 
+void Control::Impl::SetLayoutingRequired( bool layoutingRequired )
+{
+  mControlImpl.mImpl->mIsLayoutingRequired = layoutingRequired;
+}
+
+bool Control::Impl::IsLayoutingRequired()
+{
+  return mControlImpl.mImpl->mIsLayoutingRequired;
+}
+
 } // namespace Internal
 
 } // namespace Toolkit
index d2eb48e..1afa0a2 100755 (executable)
@@ -345,6 +345,16 @@ public:
    */
   void RemoveLayout();
 
+  /**
+   * @copydoc DevelControl::SetLayoutingRequired
+   */
+  void SetLayoutingRequired( bool layoutingRequired );
+
+  /**
+   * @copydoc DevelControl::IsLayoutingRequired()
+   */
+  bool IsLayoutingRequired();
+
 private:
 
   /**
@@ -423,6 +433,7 @@ public:
   ControlBehaviour mFlags : CONTROL_BEHAVIOUR_FLAG_COUNT;    ///< Flags passed in from constructor.
   bool mIsKeyboardNavigationSupported :1;  ///< Stores whether keyboard navigation is supported by the control.
   bool mIsKeyboardFocusGroup :1;           ///< Stores whether the control is a focus group.
+  bool mIsLayoutingRequired :1;            ///< Stores whether the control needs to be Layout
 
   RegisteredVisualContainer mRemoveVisuals;         ///< List of visuals that are being replaced by another visual once ready
 
index 14fed57..5c5989d 100644 (file)
@@ -157,6 +157,12 @@ void AbsoluteLayout::OnLayout( bool changed, LayoutLength left, LayoutLength top
       auto childTop = childPosition.y;
       auto childLeft = childPosition.x;
 
+      DALI_LOG_INFO( gLogFilter, Debug::General, "AbsoluteLayout::OnLayout child[%s] position(%f,%f) child width[%d] height(%d)\n",
+                      Toolkit::Control::DownCast( childOwner ).GetName().c_str(),
+                      childPosition.x, childPosition.y,
+                      childWidth.mValue, childHeight.mValue
+                      );
+
       childLayout->Layout( childLeft, childTop, childLeft + childWidth, childTop + childHeight );
     }
   }
index 0e8d925..cfceb62 100644 (file)
@@ -110,7 +110,7 @@ void LayoutController::MeasureHierarchy( Actor root, MeasureSpec widthSpec, Meas
   Toolkit::Control control = Toolkit::Control::DownCast( root );
   if( control )
   {
-    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "LayoutController::Measuring control\n" );
+    DALI_LOG_INFO( gLogFilter, Debug::Verbose, "LayoutController::Measuring control:%s\n", control.GetName().c_str() );
     Internal::Control& controlImpl = GetImplementation( control );
 
     Internal::Control::Impl& controlDataImpl = Internal::Control::Impl::Get( controlImpl );