[dali_1.3.50] Merge branch 'devel/master' 58/193258/1
authoradam.b <adam.b@samsung.com>
Fri, 16 Nov 2018 12:22:07 +0000 (12:22 +0000)
committeradam.b <adam.b@samsung.com>
Fri, 16 Nov 2018 12:22:07 +0000 (12:22 +0000)
Change-Id: Id960f372ed013b0d480d958536dbd625633908fa

README.md
automated-tests/src/dali-toolkit/utc-Dali-LayoutingNesting.cpp
dali-toolkit/devel-api/layouting/layout-group-impl.cpp
dali-toolkit/internal/layouting/layout-group-data-impl.cpp
dali-toolkit/internal/layouting/layout-group-data-impl.h
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index 0c20358..01c32a9 100644 (file)
--- a/README.md
+++ b/README.md
 
 ## 1. Building for Ubuntu desktop
 
-### Minimum Requirements
+### Requirements
 
  - Ubuntu 14.04 or later
  - Environment created using dali_env script in dali-core repository
+ - GCC version 6
+
+DALi requires a compiler supporting C++11 features.
+Ubuntu 16.04 is the first version to offer this by default (GCC v5.4.0).
+
+GCC version 6 is recommended since it has fixes for issues in version 5
+e.g. it avoids spurious 'defined but not used' warnings in header files.
 
 ### Building the Repository
 
index 155b54a..a21b1b8 100644 (file)
@@ -71,9 +71,7 @@ int UtcDaliLayoutingNesting_01(void)
     |
   Control (LinearLayout Horizontal)
     |
-  Control (LayoutingRequired)
-    |
-  Control (LinearLayout Horizontal)
+  Control (LinearLayout Vertical)
     |
   LeafControl
 
@@ -82,8 +80,6 @@ int UtcDaliLayoutingNesting_01(void)
   ToolkitTestApplication application;
   tet_infoline("UtcDaliLayoutingNesting_01 - Nesting a LinearLayout (MATCH_PARENT) containing a leaf control within a LinearLayout");
 
-  Stage stage = Stage::GetCurrent();
-
   auto rootControl = Control::New();
   SetupRootLayoutControl( rootControl );
 
@@ -110,7 +106,7 @@ int UtcDaliLayoutingNesting_01(void)
 
   for( auto&& iter : controls )
   {
-    hbox.Add( iter );
+    vbox.Add( iter );
   }
 
   rootControl.Add( hbox );
@@ -134,10 +130,8 @@ int UtcDaliLayoutingNesting_02(void)
   Root
     |
   Control (LinearLayout Horizontal)
-    |
-  Control (LayoutingRequired)
-    |
-  Control (LinearLayout Horizontal)
+    |    |
+  Control (LinearLayout Vertical)
     |    |
   LeafControl
 
@@ -147,8 +141,6 @@ int UtcDaliLayoutingNesting_02(void)
   tet_infoline("UtcDaliLayoutingNesting_02 - Nesting a LinearLayout (MATCH_PARENT) containing a leaf control within a LinearLayout");
   tet_infoline("Then change the parent's size and test child responded correctly");
 
-  Stage stage = Stage::GetCurrent();
-
   auto rootControl = Control::New();
   SetupRootLayoutControl( rootControl );
 
@@ -175,7 +167,7 @@ int UtcDaliLayoutingNesting_02(void)
 
   for( auto&& iter : controls )
   {
-    hbox.Add( iter );
+    vbox.Add( iter );
   }
 
   rootControl.Add( hbox );
@@ -200,4 +192,63 @@ int UtcDaliLayoutingNesting_02(void)
   DALI_TEST_EQUALS( controls[0].GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 40.0f, 40.0f, 0.0f ), 0.0001f, TEST_LOCATION );
 
   END_TEST;
+}
+
+int UtcDaliLayoutingNesting_LeafSizeChange(void)
+{
+ /*
+  Root
+    |
+  Control (LayoutingRequired)
+    |
+  Control (LinearLayout Horizontal)  (WRAP_CONTENT)
+    |    |
+  TextLabel
+  */
+
+  ToolkitTestApplication application;
+  tet_infoline("UtcDaliLayoutingNesting_LeafSizeChange - Nesting a TextLabel within a layout that is parented to a control");
+  tet_infoline("Then change the TextLabels size and test the parent resized to wrap the new size");
+
+  auto rootControl = Control::New();
+  SetupRootLayoutControl( rootControl );
+
+  auto control = Control::New();
+  DevelControl::SetLayoutingRequired( control, true );
+  control.SetName( "control" );
+
+  auto hbox = Control::New();
+  auto hboxLayout = LinearLayout::New();
+  hboxLayout.SetOrientation( LinearLayout::Orientation::HORIZONTAL );
+  DevelControl::SetLayout( hbox, hboxLayout );
+  hbox.SetName( "hBox" );
+  hbox.SetProperty( Toolkit::LayoutItem::ChildProperty::WIDTH_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
+  hbox.SetProperty( Toolkit::LayoutItem::ChildProperty::HEIGHT_SPECIFICATION, ChildLayoutData::WRAP_CONTENT );
+
+  control.Add( hbox );
+
+  TextLabel textLabel = CreateTextLabel("SmallText" );
+
+  hbox.Add( textLabel );
+
+  rootControl.Add( control );
+
+  // Ensure layouting happens
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( hbox.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 260.0f, 64.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( textLabel.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 260.0f, 64.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+  tet_infoline("Changing to longer text");
+  textLabel.SetProperty( TextLabel::Property::TEXT, "muchlongerText" );
+
+  // Ensure layouting happens
+  application.SendNotification();
+  application.Render();
+
+  DALI_TEST_EQUALS( hbox.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 432.0f, 64.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+  DALI_TEST_EQUALS( textLabel.GetProperty<Vector3>( Actor::Property::SIZE ), Vector3( 432.0f, 64.0f, 0.0f ), 0.0001f, TEST_LOCATION );
+
+  END_TEST;
 }
\ No newline at end of file
index cec64d4..8ddc819 100644 (file)
@@ -784,11 +784,13 @@ void LayoutGroup::OnMeasure( MeasureSpec widthMeasureSpec, MeasureSpec heightMea
         // Check below will be true for legacy containers and controls with layout required set.
         // Other layouts will have their own OnMeasure (a checked requirement) hence not execute LayoutGroup::OnMeasure.
         // Controls which have set layout required will not be legacy controls hence should not have a ResizePolicy set.
-        if( childControl.GetChildCount() > 0 )
+        // Only need to map the resize policy the first time as the Layouting system will then set it to FIXED.
+        if( childControl.GetChildCount() > 0 && ! mImpl->mResizePolicyMapped )
         {
           // First pass, Static mappings that are not dependant on parent
           SizeNegotiationMapper::SetLayoutParametersUsingResizePolicy( childControl, childLayout, Dimension::WIDTH );
           SizeNegotiationMapper::SetLayoutParametersUsingResizePolicy( childControl, childLayout, Dimension::HEIGHT );
+          mImpl->mResizePolicyMapped = true;
         }
 
         // Second pass, if any mappings were not possible due to parent size dependancies then calculate an exact desired size for child
index f1d7fea..56e92a3 100644 (file)
@@ -26,7 +26,8 @@ namespace Internal
 
 LayoutGroup::Impl::Impl()
 : mChildren(),
-  mNextLayoutId(1)
+  mNextLayoutId(1),
+  mResizePolicyMapped( false )
 {
 }
 
index 231cc09..02a4716 100644 (file)
@@ -44,6 +44,7 @@ public:
 
   std::vector<ChildLayout> mChildren;
   Toolkit::LayoutGroup::LayoutId mNextLayoutId;
+  bool mResizePolicyMapped;
 };
 
 
index fdfca42..6ab69a5 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 3;
-const unsigned int TOOLKIT_MICRO_VERSION = 49;
+const unsigned int TOOLKIT_MICRO_VERSION = 50;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index a3b4879..319ca17 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    1.3.49
+Version:    1.3.50
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT