- std::string colorStr;
- Vector4ToColorString( color, colorStr );
- map.Insert( COLOR_KEY, colorStr );
+ bool enabled = false;
+ bool colorDefined = false;
+ Vector4 color;
+
+ bool empty = true;
+
+ if(!propertiesMap.Empty())
+ {
+ empty = ParseBackgroundProperties(propertiesMap,
+ enabled,
+ colorDefined,
+ color);
+ }
+
+ if(!empty)
+ {
+ if(enabled != controller->IsBackgroundEnabled())
+ {
+ controller->SetBackgroundEnabled(enabled);
+ update = true;
+ }
+
+ if(colorDefined && (controller->GetBackgroundColor() != color))
+ {
+ controller->SetBackgroundColor(color);
+ update = true;
+ }
+ }
+ else
+ {
+ // Disable background.
+ if(controller->IsBackgroundEnabled())
+ {
+ controller->SetBackgroundEnabled(false);
+ update = true;
+ }
+ }
+ break;
+ }
+ case EffectStyle::INPUT:
+ {
+ // Text background is not supported while inputting yet
+ break;
+ }
+ } // switch
+ } // if( controller )
+
+ return update;
+}
+
+void GetBackgroundProperties(ControllerPtr controller, Property::Value& value, EffectStyle::Type type)
+{
+ if(controller)
+ {
+ switch(type)
+ {
+ case EffectStyle::DEFAULT:
+ {
+ const bool enabled = controller->IsBackgroundEnabled();
+ const Vector4& color = controller->GetBackgroundColor();