X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fcontrol-impl.cpp;fp=dali-toolkit%2Fpublic-api%2Fcontrols%2Fcontrol-impl.cpp;h=88b588d53fca794b76ec24486c48169992e83e5a;hp=7bcaad4ab4c67cb113e255dd3af8d30672d59f49;hb=31df2b9472ccbe0ae460a958535be8ef790c96f2;hpb=c6032a09ae68156bcdaef2f09fbb4617245bc75f diff --git a/dali-toolkit/public-api/controls/control-impl.cpp b/dali-toolkit/public-api/controls/control-impl.cpp index 7bcaad4..88b588d 100644 --- a/dali-toolkit/public-api/controls/control-impl.cpp +++ b/dali-toolkit/public-api/controls/control-impl.cpp @@ -425,17 +425,12 @@ public: case Toolkit::Control::Property::BACKGROUND_IMAGE: { - if ( value.HasKey( "image" ) ) + Image image = Scripting::NewImage( value ); + if ( image ) { - Property::Map imageMap = value.GetValue( "image" ).Get< Property::Map >(); - Image image = Scripting::NewImage( imageMap ); - - if ( image ) - { - controlImpl.SetBackgroundImage( image ); - } + controlImpl.SetBackgroundImage( image ); } - else if ( value.Get< Property::Map >().Empty() ) + else { // An empty map means the background is no longer required controlImpl.ClearBackground(); @@ -499,9 +494,7 @@ public: Image image = back->actor.GetRendererAt(0).GetMaterial().GetSamplerAt(0).GetImage(); if ( image ) { - Property::Map imageMap; - Scripting::CreatePropertyMap( image, imageMap ); - map[ "image" ] = imageMap; + Scripting::CreatePropertyMap( image, map ); } } @@ -875,6 +868,9 @@ Control::Control( ControlBehaviour behaviourFlags ) void Control::Initialize() { + // Call deriving classes so initialised before styling is applied to them. + OnInitialize(); + if( mImpl->mFlags & REQUIRES_STYLE_CHANGE_SIGNALS ) { Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get(); @@ -882,7 +878,7 @@ void Control::Initialize() // Register for style changes styleManager.StyleChangeSignal().Connect( this, &Control::OnStyleChange ); - // SetTheme + // Apply the current style GetImpl( styleManager ).ApplyThemeStyle( Toolkit::Control( GetOwner() ) ); } @@ -890,9 +886,6 @@ void Control::Initialize() { SetKeyboardNavigationSupport( true ); } - - // Calling deriving classes - OnInitialize(); } void Control::OnInitialize()