#include <dali/integration-api/debug.h>
//INTERNAL HEARDER
+#include <dali-toolkit/devel-api/visuals/visual-actions-devel.h>
#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
#include <dali-toolkit/internal/helpers/property-helper.h>
#include <dali-toolkit/internal/visuals/visual-base-data-impl.h>
void Visual::Base::DoAction(const Property::Index actionId, const Property::Value attributes)
{
OnDoAction(actionId, attributes);
+
+ // Check if action is valid for this visual type and perform action if possible
+ switch(actionId)
+ {
+ case DevelVisual::Action::UPDATE_PROPERTY:
+ {
+ const Property::Map* map = attributes.GetMap();
+ if(map)
+ {
+ SetProperties(*map);
+ }
+ break;
+ }
+ }
}
void Visual::Base::SetDepthIndex(int index)
// Update values from Renderer
mImpl->mCornerRadius = mImpl->mRenderer.GetProperty<Vector4>(mImpl->mCornerRadiusIndex);
}
- return !(mImpl->mCornerRadius == Vector4::ZERO) || mImpl->mNeedCornerRadius;
+ return !(mImpl->mCornerRadius == Vector4::ZERO) || mImpl->mAlwaysUsingCornerRadius;
}
return false;
}
// Update values from Renderer
mImpl->mBorderlineWidth = mImpl->mRenderer.GetProperty<float>(mImpl->mBorderlineWidthIndex);
}
- return !EqualsZero(mImpl->mBorderlineWidth) || mImpl->mNeedBorderline;
+ return !EqualsZero(mImpl->mBorderlineWidth) || mImpl->mAlwaysUsingBorderline;
}
return false;
}
mImpl->mBorderlineWidthIndex = mImpl->mRenderer.RegisterProperty(DevelVisual::Property::BORDERLINE_WIDTH, BORDERLINE_WIDTH, mImpl->mBorderlineWidth);
mImpl->mBorderlineColorIndex = mImpl->mRenderer.RegisterProperty(DevelVisual::Property::BORDERLINE_COLOR, BORDERLINE_COLOR, mImpl->mBorderlineColor);
mImpl->mBorderlineOffsetIndex = mImpl->mRenderer.RegisterProperty(DevelVisual::Property::BORDERLINE_OFFSET, BORDERLINE_OFFSET, mImpl->mBorderlineOffset);
- mImpl->mNeedBorderline = true;
+
+ // Borderline is animated now. we always have to use borderline feature.
+ mImpl->mAlwaysUsingBorderline = true;
index = mImpl->mRenderer.GetPropertyIndex(key);
mImpl->mCornerRadiusIndex = mImpl->mRenderer.RegisterProperty(DevelVisual::Property::CORNER_RADIUS, CORNER_RADIUS, mImpl->mCornerRadius);
mImpl->mRenderer.RegisterProperty(CORNER_RADIUS_POLICY, mImpl->mCornerRadiusPolicy);
- if(!mImpl->mNeedBorderline)
+ // ConerRadius is animated now. we always have to use corner radius feature.
+ mImpl->mAlwaysUsingCornerRadius = true;
+
+ if(!IsBorderlineRequired())
{
- // If mNeedBorderline is true, BLEND_MODE is already BlendMode::ON_WITHOUT_CULL. So we don't overwrite it.
+ // If IsBorderlineRequired is true, BLEND_MODE is already BlendMode::ON_WITHOUT_CULL. So we don't overwrite it.
mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
}
- index = mImpl->mCornerRadiusIndex;
- mImpl->mNeedCornerRadius = true;
+ index = mImpl->mCornerRadiusIndex;
// Change shader
UpdateShader();