mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
}
+ if(IsBorderlineRequired())
+ {
+ 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->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
+ }
}
}
{
matchKey = Property::Key(Toolkit::DevelVisual::Property::VISUAL_FITTING_MODE);
}
+ else if(matchKey == BORDERLINE_WIDTH)
+ {
+ matchKey = Property::Key(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH);
+ }
+ else if(matchKey == BORDERLINE_COLOR)
+ {
+ matchKey = Property::Key(Toolkit::DevelVisual::Property::BORDERLINE_COLOR);
+ }
+ else if(matchKey == BORDERLINE_OFFSET)
+ {
+ matchKey = Property::Key(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET);
+ }
else if(matchKey == CORNER_RADIUS)
{
matchKey = Property::Key(Toolkit::DevelVisual::Property::CORNER_RADIUS);
value, VISUAL_FITTING_MODE_TABLE, VISUAL_FITTING_MODE_TABLE_COUNT, mImpl->mFittingMode);
break;
}
+ case Toolkit::DevelVisual::Property::BORDERLINE_WIDTH:
+ {
+ float width;
+ if(value.Get(width))
+ {
+ mImpl->mBorderlineWidth = width;
+ }
+ break;
+ }
+ case Toolkit::DevelVisual::Property::BORDERLINE_COLOR:
+ {
+ Vector4 color;
+ if(value.Get(color))
+ {
+ mImpl->mBorderlineColor = color;
+ }
+ break;
+ }
+ case Toolkit::DevelVisual::Property::BORDERLINE_OFFSET:
+ {
+ float offset;
+ if(value.Get(offset))
+ {
+ mImpl->mBorderlineOffset = offset;
+ }
+ break;
+ }
case Toolkit::DevelVisual::Property::CORNER_RADIUS:
{
if(value.GetType() == Property::VECTOR4)
{
mImpl->mCornerRadius = mImpl->mRenderer.GetProperty<Vector4>(mImpl->mCornerRadiusIndex);
}
+ if(mImpl->mBorderlineWidthIndex != Property::INVALID_INDEX)
+ {
+ mImpl->mBorderlineWidth = mImpl->mRenderer.GetProperty<float>(mImpl->mBorderlineWidthIndex);
+ }
+ if(mImpl->mBorderlineColorIndex != Property::INVALID_INDEX)
+ {
+ mImpl->mBorderlineColor = mImpl->mRenderer.GetProperty<Vector4>(mImpl->mBorderlineColorIndex);
+ }
+ if(mImpl->mBorderlineOffsetIndex != Property::INVALID_INDEX)
+ {
+ mImpl->mBorderlineOffset = mImpl->mRenderer.GetProperty<float>(mImpl->mBorderlineOffsetIndex);
+ }
}
DoCreatePropertyMap(map);
mImpl->mFittingMode, VISUAL_FITTING_MODE_TABLE, VISUAL_FITTING_MODE_TABLE_COUNT);
map.Insert(Toolkit::DevelVisual::Property::VISUAL_FITTING_MODE, fittingModeString);
+ map.Insert(Toolkit::DevelVisual::Property::BORDERLINE_WIDTH, mImpl->mBorderlineWidth);
+ map.Insert(Toolkit::DevelVisual::Property::BORDERLINE_COLOR, mImpl->mBorderlineColor);
+ map.Insert(Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, mImpl->mBorderlineOffset);
+
map.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS, mImpl->mCornerRadius);
map.Insert(Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY, static_cast<int>(mImpl->mCornerRadiusPolicy));
}
return !(mImpl->mCornerRadius == Vector4::ZERO) || mImpl->mNeedCornerRadius;
}
+bool Visual::Base::IsBorderlineRequired() const
+{
+ if(mImpl->mRenderer && mImpl->mBorderlineWidthIndex != Property::INVALID_INDEX)
+ {
+ // Update values from Renderer
+ mImpl->mBorderlineWidth = mImpl->mRenderer.GetProperty<float>(mImpl->mBorderlineWidthIndex);
+ }
+ return !EqualsZero(mImpl->mBorderlineWidth) || mImpl->mNeedBorderline;
+}
+
void Visual::Base::OnDoAction(const Property::Index actionId, const Property::Value& attributes)
{
// May be overriden by derived class
Property::Index index = GetPropertyIndex(key);
if(index == Property::INVALID_INDEX)
{
- if((key.type == Property::Key::INDEX && key.indexKey == DevelVisual::Property::CORNER_RADIUS) || (key.type == Property::Key::STRING && key.stringKey == CORNER_RADIUS))
+ if((key.type == Property::Key::INDEX && key.indexKey == DevelVisual::Property::BORDERLINE_WIDTH) || (key.type == Property::Key::STRING && key.stringKey == BORDERLINE_WIDTH) ||
+ (key.type == Property::Key::INDEX && key.indexKey == DevelVisual::Property::BORDERLINE_COLOR) || (key.type == Property::Key::STRING && key.stringKey == BORDERLINE_COLOR) ||
+ (key.type == Property::Key::INDEX && key.indexKey == DevelVisual::Property::BORDERLINE_OFFSET) || (key.type == Property::Key::STRING && key.stringKey == BORDERLINE_OFFSET))
+ {
+ mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
+
+ // Register borderline properties
+ 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;
+
+ index = mImpl->mRenderer.GetPropertyIndex(key);
+
+ // Change shader
+ UpdateShader();
+ }
+ else if((key.type == Property::Key::INDEX && key.indexKey == DevelVisual::Property::CORNER_RADIUS) || (key.type == Property::Key::STRING && key.stringKey == CORNER_RADIUS))
{
// Register CORNER_RADIUS property
mImpl->mCornerRadiusIndex = mImpl->mRenderer.RegisterProperty(DevelVisual::Property::CORNER_RADIUS, CORNER_RADIUS, mImpl->mCornerRadius);