X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fbuttons%2Fbutton-impl.cpp;h=53ccf416bf2426e9926060f51262cbd27ce68ecc;hp=07722b96bc8c0a286ba12a3e4a11cd56ec1909b6;hb=e14d00568eab69d46e78db427d91e33513fd662b;hpb=f31a7b83577275e88914a00f37c4ff5224336553 diff --git a/dali-toolkit/internal/controls/buttons/button-impl.cpp b/dali-toolkit/internal/controls/buttons/button-impl.cpp index 07722b9..53ccf41 100644 --- a/dali-toolkit/internal/controls/buttons/button-impl.cpp +++ b/dali-toolkit/internal/controls/buttons/button-impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2016 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,7 +29,9 @@ // INTERNAL INCLUDES #include #include -#include +#include +#include + /** * Button states and contents @@ -537,6 +539,7 @@ void Button::SetColor( const Vector4& color, Button::PaintState selectedState ) { Actor* contentActor = NULL; // Using a pointer as SetupContent assigns the new Actor to this. bool imageFileExists = false; + Property::Index visualIndex = Toolkit::Button::Property::SELECTED_STATE_IMAGE; if ( selectedState == SelectedState || selectedState == DisabledSelectedState ) { @@ -549,6 +552,7 @@ void Button::SetColor( const Vector4& color, Button::PaintState selectedState ) mUnselectedColor = color; contentActor = &mUnselectedContent; imageFileExists = !GetUnselectedImageFilename().empty(); + visualIndex = Toolkit::Button::Property::UNSELECTED_STATE_IMAGE; } if ( contentActor ) @@ -562,15 +566,17 @@ void Button::SetColor( const Vector4& color, Button::PaintState selectedState ) { // If there is no existing content, create a new actor to use for flat color. Actor placementActor = Actor::New(); - Toolkit::VisualFactory rendererFactory = Toolkit::VisualFactory::Get(); - Toolkit::Visual colorRenderer; + Toolkit::VisualFactory visualFactory = Toolkit::VisualFactory::Get(); + Toolkit::Visual::Base visual; Property::Map map; - map["rendererType"] = "COLOR"; - map["mixColor"] = color; + map[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::COLOR; + map[ Toolkit::ColorVisual::Property::MIX_COLOR ] = color; + + visual = visualFactory.CreateVisual( map ); - colorRenderer = rendererFactory.CreateVisual( map ); - colorRenderer.SetOnStage( placementActor ); + RegisterVisual( visualIndex, placementActor, visual ); + visual.SetOnStage( placementActor ); SetupContent( *contentActor, placementActor ); // contentActor->SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );