Merge "Text improvement 1. Text - Layout text & icons. * Feature added to layout...
authorjoogab yun <joogab.yun@samsung.com>
Wed, 20 Feb 2019 00:39:56 +0000 (00:39 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Wed, 20 Feb 2019 00:39:56 +0000 (00:39 +0000)
automated-tests/src/dali-toolkit/utc-Dali-AbsoluteLayout.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
dali-toolkit/internal/layouting/layout-controller-impl.cpp
dali-toolkit/internal/text/text-effects-style.cpp

index 395e8f9..98ea974 100644 (file)
@@ -69,7 +69,6 @@ int UtcDaliLayouting_AbsoluteLayoutAssignment(void)
   END_TEST;
 }
 
-
 int UtcDaliLayouting_AbsoluteLayout01(void)
 {
   ToolkitTestApplication application;
@@ -120,3 +119,43 @@ int UtcDaliLayouting_AbsoluteLayout01(void)
 
   END_TEST;
 }
+
+int UtcDaliLayouting_AbsoluteLayout_SetPosition(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline(" UtcDaliLayouting_AbsoluteLayout_GetWorldPosition - Testing WorldPosition");
+
+  Stage stage = Stage::GetCurrent();
+
+  Dali::Toolkit::Control layoutControl = Dali::Toolkit::Control::New();
+  layoutControl.SetName("AsoluteLayout");
+  layoutControl.SetAnchorPoint( Dali::AnchorPoint::CENTER );
+  layoutControl.SetParentOrigin( Dali::ParentOrigin::CENTER );
+
+  Dali::Toolkit::AbsoluteLayout absoluteLayout = Dali::Toolkit::AbsoluteLayout::New();
+  Dali::Toolkit::DevelControl::SetLayout( layoutControl, absoluteLayout );
+
+  stage.GetRootLayer().Add( layoutControl );
+
+  // Ensure layouting happens
+  application.SendNotification();
+  application.Render(0);
+
+  Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
+  control.SetSize( 100.0f, 100.0f );
+  control.SetParentOrigin( ParentOrigin::CENTER );
+  control.SetAnchorPoint( AnchorPoint::CENTER );
+  Vector3 parentPosition( 1.0f, 2.0f, 3.0f );
+  control.SetPosition( parentPosition );
+
+  layoutControl.Add( control );
+
+  // Ensure layouting happens
+  application.SendNotification();
+  application.Render(0);
+
+  // The value of z should not be zero
+  DALI_TEST_EQUALS( control.GetCurrentPosition(), parentPosition, TEST_LOCATION );
+
+  END_TEST;
+}
index 3e3b0e3..251b339 100755 (executable)
@@ -761,9 +761,9 @@ int UtcDaliTextEditorSetPropertyP(void)
   Property::Map underlineMapSet;
   Property::Map underlineMapGet;
 
-  underlineMapSet.Insert( "enable", "true" );
-  underlineMapSet.Insert( "color", "red" );
-  underlineMapSet.Insert( "height", "1" );
+  underlineMapSet.Insert( "enable", true );
+  underlineMapSet.Insert( "color", Color::RED );
+  underlineMapSet.Insert( "height", 1 );
 
   editor.SetProperty( TextEditor::Property::UNDERLINE, underlineMapSet );
 
@@ -2596,9 +2596,9 @@ int utcDaliTextEditorUnderPropertyStringP(void)
   // Check the input underline property
   Property::Map underlineMapSet;
   Property::Map underlineMapGet;
-  underlineMapSet.Insert( "enable", "true" );
-  underlineMapSet.Insert( "color", "blue" );
-  underlineMapSet.Insert( "height", "2" );
+  underlineMapSet.Insert( "enable", true );
+  underlineMapSet.Insert( "color", Color::BLUE );
+  underlineMapSet.Insert( "height", 2 );
 
   editor.SetProperty( TextEditor::Property::UNDERLINE, underlineMapSet );
   underlineMapGet = editor.GetProperty<Property::Map>( TextEditor::Property::UNDERLINE );
index 39cd605..8b1005f 100755 (executable)
@@ -806,9 +806,9 @@ int UtcDaliTextFieldSetPropertyP(void)
   Property::Map underlineMapSet;
   Property::Map underlineMapGet;
 
-  underlineMapSet.Insert( "enable", "true" );
-  underlineMapSet.Insert( "color", "red" );
-  underlineMapSet.Insert( "height", "1" );
+  underlineMapSet.Insert( "enable", true );
+  underlineMapSet.Insert( "color", Color::RED );
+  underlineMapSet.Insert( "height", 1 );
 
   // Check the underline property
   field.SetProperty( TextField::Property::UNDERLINE, underlineMapSet );
index 551acf2..1208543 100755 (executable)
@@ -372,9 +372,9 @@ int UtcDaliToolkitTextLabelSetPropertyP(void)
   Property::Map underlineMapSet;
   Property::Map underlineMapGet;
 
-  underlineMapSet.Insert( "enable", "false" );
-  underlineMapSet.Insert( "color", "blue" );
-  underlineMapSet.Insert( "height", "0" );
+  underlineMapSet.Insert( "enable", false );
+  underlineMapSet.Insert( "color", Color::BLUE );
+  underlineMapSet.Insert( "height", 0 );
 
   underlineMapGet = label.GetProperty<Property::Map>( TextLabel::Property::UNDERLINE );
   DALI_TEST_EQUALS( underlineMapGet.Count(), underlineMapSet.Count(), TEST_LOCATION );
@@ -465,9 +465,9 @@ int UtcDaliToolkitTextLabelSetPropertyP(void)
 
   // Check the underline property
   underlineMapSet.Clear();
-  underlineMapSet.Insert( "enable", "true" );
-  underlineMapSet.Insert( "color", "red" );
-  underlineMapSet.Insert( "height", "1" );
+  underlineMapSet.Insert( "enable", true );
+  underlineMapSet.Insert( "color", Color::RED );
+  underlineMapSet.Insert( "height", 1 );
 
   label.SetProperty( TextLabel::Property::UNDERLINE, underlineMapSet );
 
@@ -479,9 +479,9 @@ int UtcDaliToolkitTextLabelSetPropertyP(void)
   DALI_TEST_EQUALS( DaliTestCheckMaps( underlineMapGet, underlineMapSet ), true, TEST_LOCATION );
 
   underlineMapSet.Clear();
-  underlineMapSet.Insert( Toolkit::DevelText::Underline::Property::ENABLE, "true" );
-  underlineMapSet.Insert( Toolkit::DevelText::Underline::Property::COLOR, "green" );
-  underlineMapSet.Insert( Toolkit::DevelText::Underline::Property::HEIGHT, "2" );
+  underlineMapSet.Insert( Toolkit::DevelText::Underline::Property::ENABLE, true );
+  underlineMapSet.Insert( Toolkit::DevelText::Underline::Property::COLOR, Color::GREEN );
+  underlineMapSet.Insert( Toolkit::DevelText::Underline::Property::HEIGHT, 2 );
 
   label.SetProperty( TextLabel::Property::UNDERLINE, underlineMapSet );
 
@@ -496,9 +496,9 @@ int UtcDaliToolkitTextLabelSetPropertyP(void)
   underlineMapSet.Clear();
 
   Property::Map underlineDisabledMapGet;
-  underlineDisabledMapGet.Insert( "enable", "false" );
-  underlineDisabledMapGet.Insert( "color", "green" );
-  underlineDisabledMapGet.Insert( "height", "2" );
+  underlineDisabledMapGet.Insert( "enable", false );
+  underlineDisabledMapGet.Insert( "color", Color::GREEN );
+  underlineDisabledMapGet.Insert( "height", 2 );
 
   label.SetProperty( TextLabel::Property::UNDERLINE, underlineMapSet );
 
@@ -646,8 +646,8 @@ int UtcDaliToolkitTextlabelAtlasRenderP(void)
   label.SetProperty( TextLabel::Property::MULTI_LINE, true );
 
   Property::Map underlineMap;
-  underlineMap.Insert( "enable", "true" );
-  underlineMap.Insert( "color", "red" );
+  underlineMap.Insert( "enable", true );
+  underlineMap.Insert( "color", Color::RED );
   label.SetProperty( TextLabel::Property::UNDERLINE, underlineMap );
 
   Property::Map shadowMap;
index c4df701..4e259e1 100644 (file)
@@ -1193,7 +1193,7 @@ int UtcDaliVisualGetPropertyMap10(void)
   propertyMap.Insert( "shadow", shadowMapSet.Add("color", Color::RED).Add("offset", Vector2(2.0f, 2.0f)).Add("blurRadius", 3.0f) );
 
   Property::Map underlineMapSet;
-  propertyMap.Insert( "underline", underlineMapSet.Add("enable", "true").Add("color", "green").Add("height", "1") );
+  propertyMap.Insert( "underline", underlineMapSet.Add("enable", true).Add("color", Color::GREEN).Add("height", 1) );
 
   Property::Map outlineMapSet;
   propertyMap.Insert( "outline", outlineMapSet.Add("color", Color::YELLOW).Add("width", 1) );
index 9d0b947..b0637b3 100644 (file)
@@ -347,13 +347,19 @@ void LayoutController::PerformLayoutPositioning( LayoutPositionDataArray& layout
     {
       if( !layoutPositionData.animated )
       {
-        actor.SetPosition( layoutPositionData.left, layoutPositionData.top );
-        actor.SetSize( layoutPositionData.right - layoutPositionData.left, layoutPositionData.bottom - layoutPositionData.top );
+        actor.SetX( layoutPositionData.left );
+        actor.SetY( layoutPositionData.top );
+
+        actor.SetProperty( Actor::Property::SIZE_WIDTH, layoutPositionData.right - layoutPositionData.left );
+        actor.SetProperty( Actor::Property::SIZE_HEIGHT, layoutPositionData.bottom - layoutPositionData.top );
       }
       else
       {
-        actor.SetPosition( actor.GetCurrentPosition() );
-        actor.SetSize( actor.GetCurrentSize() );
+        actor.SetX( actor.GetCurrentPosition().x );
+        actor.SetY( actor.GetCurrentPosition().y );
+
+        actor.SetProperty( Actor::Property::SIZE_WIDTH, actor.GetCurrentSize().x );
+        actor.SetProperty( Actor::Property::SIZE_HEIGHT, actor.GetCurrentSize().y );
       }
     }
   }
index 015bee3..d5f8ff1 100755 (executable)
@@ -358,16 +358,9 @@ void GetUnderlineProperties( ControllerPtr controller, Property::Value& value, E
         {
           Property::Map map;
 
-          const std::string enabledStr = enabled ? TRUE_TOKEN : FALSE_TOKEN;
-          map.Insert( ENABLE_KEY, enabledStr );
-
-          std::string colorStr;
-          Vector4ToColorString( color, colorStr );
-          map.Insert( COLOR_KEY, colorStr );
-
-          std::string heightStr;
-          FloatToString( height, heightStr );
-          map.Insert( HEIGHT_KEY, heightStr );
+          map.Insert( ENABLE_KEY, enabled );
+          map.Insert( COLOR_KEY, color );
+          map.Insert( HEIGHT_KEY, height );
 
           value = map;
         }