Merge "Fix for font validation." into devel/master
authorPaul Wisbey <p.wisbey@samsung.com>
Thu, 7 Apr 2016 09:09:34 +0000 (02:09 -0700)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Thu, 7 Apr 2016 09:09:34 +0000 (02:09 -0700)
automated-tests/src/dali-toolkit/utc-Dali-Control.cpp
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/styles/480x800/dali-toolkit-default-theme.json
dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json

index 2163a19..588c7c5 100644 (file)
@@ -450,21 +450,12 @@ int UtcDaliControlBackgroundProperties(void)
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
   DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND ).Get< Property::Map >().Empty() );
 
-  Property::Map colorMap;
-  colorMap["color"] = Color::RED;
-  control.SetProperty( Control::Property::BACKGROUND, colorMap );
-  Property::Value propValue = control.GetProperty( Control::Property::BACKGROUND );
-  Property::Map* resultMap = propValue.GetMap();
-  DALI_TEST_CHECK( resultMap->Find( "rendererType" ) );
-  DALI_TEST_CHECK( resultMap->Find( "rendererType" )->Get<std::string>() == "color" );
-  DALI_TEST_CHECK( resultMap->Find( "blendColor" ) );
-  DALI_TEST_CHECK( resultMap->Find( "blendColor" )->Get<Vector4>() == Color::RED );
-
   Property::Map imageMap;
-  imageMap[ "filename" ] = "TestImage";
+  imageMap[ "rendererType" ] = "image";
+  imageMap[ "imageUrl" ] = "TestImage";
   control.SetProperty( Control::Property::BACKGROUND, imageMap );
-  propValue = control.GetProperty( Control::Property::BACKGROUND );
-  resultMap = propValue.GetMap();
+  Property::Value propValue = control.GetProperty( Control::Property::BACKGROUND );
+  Property::Map* resultMap = propValue.GetMap();
   DALI_TEST_CHECK( resultMap->Find( "rendererType" ) );
   DALI_TEST_CHECK( resultMap->Find( "rendererType" )->Get<std::string>() == "image" );
   DALI_TEST_CHECK( resultMap->Find( "imageUrl" ) );
@@ -490,7 +481,10 @@ int UtcDaliControlBackgroundProperties(void)
   DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >() == Color::YELLOW );
   DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >() == control.GetBackgroundColor() );
   control.ClearBackground();
-  control.SetProperty( Control::Property::BACKGROUND_IMAGE, imageMap );
+
+  Property::Map deprecatedImageMap;
+  deprecatedImageMap[ "filename" ] = "TestImage";
+  control.SetProperty( Control::Property::BACKGROUND_IMAGE, deprecatedImageMap );
   propValue = control.GetProperty( Control::Property::BACKGROUND_IMAGE );
   resultMap = propValue.GetMap();
   DALI_TEST_CHECK( resultMap->Find( "imageUrl" )->Get< std::string >() == "TestImage" );
index df7bb8c..7cc7571 100644 (file)
@@ -163,7 +163,6 @@ TypeAction registerAction( typeRegistration, ACTION_ACCESSIBILITY_ACTIVATED, &Do
 
 DALI_TYPE_REGISTRATION_END()
 
-const char * const BACKGROUND_COLOR_NAME("color");
 const char * const COLOR_RENDERER_COLOR_NAME("blendColor");
 
 } // unnamed namespace
@@ -283,21 +282,16 @@ public:
 
         case Toolkit::Control::Property::BACKGROUND:
         {
-          Image image = Scripting::NewImage( value );
-          if ( image )
-          {
-            controlImpl.SetBackgroundImage( image );
-            break;
-          }
           const Property::Map* map = value.GetMap();
           if( map )
           {
             controlImpl.SetBackground( *map );
-            break;
           }
-
-          // The background is neither a valid image nor a property map, so it is no longer required
-          controlImpl.ClearBackground();
+          else
+          {
+            // The background is not a property map, so we should clear the background
+            controlImpl.ClearBackground();
+          }
           break;
         }
       }
@@ -474,14 +468,6 @@ Vector4 Control::GetBackgroundColor() const
 
 void Control::SetBackground(const Property::Map& map)
 {
-  const Property::Value* colorValue = map.Find( BACKGROUND_COLOR_NAME );
-  Vector4 color;
-  if( colorValue && colorValue->Get(color))
-  {
-    SetBackgroundColor( color );
-    return;
-  }
-
   Actor self( Self() );
   mImpl->mBackgroundRenderer.RemoveAndReset( self );
   Toolkit::RendererFactory factory = Toolkit::RendererFactory::Get();
index 113055a..46ee52d 100644 (file)
@@ -94,7 +94,8 @@
       "popupIconColor":[1.0,1.0,1.0,1.0],
       "popupPressedColor":[0.24,0.72,0.8,0.11],
       "background": {
-        "filename": "{DALI_IMAGE_DIR}selection-popup-bg.9.png"
+        "rendererType": "nPatch",
+        "imageUrl": "{DALI_IMAGE_DIR}selection-popup-bg.9.png"
         },
       "popupFadeInDuration":0.25,
       "popupFadeOutDuration":0.25
index 0dae29e..26b3c80 100644 (file)
@@ -94,7 +94,8 @@
       "popupIconColor":[1.0,1.0,1.0,1.0],
       "popupPressedColor":[0.24,0.72,0.8,0.11],
       "background": {
-        "filename": "{DALI_IMAGE_DIR}selection-popup-bg.9.png"
+        "rendererType": "nPatch",
+        "imageUrl": "{DALI_IMAGE_DIR}selection-popup-bg.9.png"
         },
       "popupFadeInDuration":0.25,
       "popupFadeOutDuration":0.25