projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Removed 3D layer dependency of Model3dView and Mesh Visual." into devel/master
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
controls
/
buttons
/
button-impl.cpp
diff --git
a/dali-toolkit/internal/controls/buttons/button-impl.cpp
b/dali-toolkit/internal/controls/buttons/button-impl.cpp
index
5e99442
..
53ccf41
100644
(file)
--- a/
dali-toolkit/internal/controls/buttons/button-impl.cpp
+++ b/
dali-toolkit/internal/controls/buttons/button-impl.cpp
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (c) 201
4
Samsung Electronics Co., Ltd.
+ * Copyright (c) 201
6
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.
*
* 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 <dali-toolkit/public-api/controls/text-controls/text-label.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/text-controls/text-label.h>
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
-#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
+#include <dali-toolkit/public-api/visuals/color-visual-properties.h>
+#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
+
/**
* Button states and contents
/**
* 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;
{
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 )
{
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();
mUnselectedColor = color;
contentActor = &mUnselectedContent;
imageFileExists = !GetUnselectedImageFilename().empty();
+ visualIndex = Toolkit::Button::Property::UNSELECTED_STATE_IMAGE;
}
if ( contentActor )
}
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();
{
// If there is no existing content, create a new actor to use for flat color.
Actor placementActor = Actor::New();
- Toolkit::
RendererFactory rendererFactory = Toolkit::Renderer
Factory::Get();
- Toolkit::
ControlRenderer colorRenderer
;
+ Toolkit::
VisualFactory visualFactory = Toolkit::Visual
Factory::Get();
+ Toolkit::
Visual::Base visual
;
Property::Map map;
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.CreateControlRenderer( map
);
-
colorRenderer
.SetOnStage( placementActor );
+
RegisterVisual( visualIndex, placementActor, visual
);
+
visual
.SetOnStage( placementActor );
SetupContent( *contentActor, placementActor ); //
contentActor->SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
SetupContent( *contentActor, placementActor ); //
contentActor->SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );