void Control::SetBackground( const Property::Map& map )
{
Actor self( Self() );
- Toolkit::Visual::Base backgroundVisual;
- InitializeVisual( self, backgroundVisual, map );
+ Toolkit::Visual::Base backgroundVisual = Toolkit::VisualFactory::Get().CreateVisual( map );
// if new visual created, replace existing one
if( backgroundVisual )
{
+ if( self.OnStage() )
+ {
+ mImpl->mBackgroundVisual.RemoveAndReset( self );
+ backgroundVisual.SetOnStage( self );
+ }
mImpl->mBackgroundVisual = backgroundVisual;
mImpl->mBackgroundVisual.SetDepthIndex( DepthIndex::BACKGROUND );
}
void Control::SetBackgroundColor( const Vector4& color )
{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetBackgroundImage() is deprecated and will be removed from next release. use Property::BACKGROUND instead.\n" );
-
Internal::GetImplementation(*this).SetBackgroundColor( color );
}
void Control::SetBackgroundImage( Image image )
{
+ DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetBackgroundImage() is deprecated and will be removed from next release. use Property::BACKGROUND instead.\n" );
+
Internal::GetImplementation(*this).SetBackgroundImage( image );
}