summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ca4209f)
Change-Id: Ica80d4844165c7bb4fa30b1be1f0338e228fe8d4
DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::INPUT_EMBOSS ), std::string("Emboss input properties"), TEST_LOCATION );
// Check the outline property
DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::INPUT_EMBOSS ), std::string("Emboss input properties"), TEST_LOCATION );
// Check the outline property
+
+ // Test string type first
+ // This is purely to maintain backward compatibility, but we don't support string as the outline property type.
+ editor.SetProperty( TextEditor::Property::OUTLINE, "Outline properties" );
+ DALI_TEST_EQUALS( editor.GetProperty<std::string>( TextEditor::Property::OUTLINE ), std::string("Outline properties"), TEST_LOCATION );
+
+ // Then test the property map type
Property::Map outlineMapSet;
Property::Map outlineMapGet;
Property::Map outlineMapSet;
Property::Map outlineMapGet;
DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_EMBOSS ), std::string("Emboss input properties"), TEST_LOCATION );
// Check the outline property
DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::INPUT_EMBOSS ), std::string("Emboss input properties"), TEST_LOCATION );
// Check the outline property
+
+ // Test string type first
+ // This is purely to maintain backward compatibility, but we don't support string as the outline property type.
+ field.SetProperty( TextField::Property::OUTLINE, "Outline properties" );
+ DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::OUTLINE ), std::string("Outline properties"), TEST_LOCATION );
+
+ // Then test the property map type
Property::Map outlineMapSet;
Property::Map outlineMapGet;
Property::Map outlineMapSet;
Property::Map outlineMapGet;
DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::EMBOSS ), std::string("Emboss properties"), TEST_LOCATION );
// Check the outline property
DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::EMBOSS ), std::string("Emboss properties"), TEST_LOCATION );
// Check the outline property
+
+ // Test string type first
+ // This is purely to maintain backward compatibility, but we don't support string as the outline property type.
+ label.SetProperty( TextLabel::Property::OUTLINE, "Outline properties" );
+ DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::OUTLINE ), std::string("Outline properties"), TEST_LOCATION );
+
+ // Then test the property map type
Property::Map outlineMapSet;
Property::Map outlineMapGet;
Property::Map outlineMapSet;
Property::Map outlineMapGet;
mAutoScrollDirectionRTL( false ),
mUnderlineSetByString( false ),
mShadowSetByString( false ),
mAutoScrollDirectionRTL( false ),
mUnderlineSetByString( false ),
mShadowSetByString( false ),
+ mOutlineSetByString( false ),
mFontStyleSetByString( false ),
mShouldClearFocusOnEscape( true )
{
mFontStyleSetByString( false ),
mShouldClearFocusOnEscape( true )
{
bool mUnderlineSetByString:1; ///< Set when underline is set by string (legacy) instead of map
bool mShadowSetByString:1; ///< Set when shadow is set by string (legacy) instead of map
bool mUnderlineSetByString:1; ///< Set when underline is set by string (legacy) instead of map
bool mShadowSetByString:1; ///< Set when shadow is set by string (legacy) instead of map
+ bool mOutlineSetByString:1; ///< Set when outline is set by string (legacy) instead of map
bool mFontStyleSetByString:1; ///< Set when font style is set by string (legacy) instead of map
bool mShouldClearFocusOnEscape:1; ///< Whether text control should clear key input focus
};
bool mFontStyleSetByString:1; ///< Set when font style is set by string (legacy) instead of map
bool mShouldClearFocusOnEscape:1; ///< Whether text control should clear key input focus
};
mImpl->mShadowSetByString = setByString;
}
mImpl->mShadowSetByString = setByString;
}
+bool Controller::IsOutlineSetByString()
+{
+ return mImpl->mOutlineSetByString;
+}
+
+void Controller::OutlineSetByString( bool setByString )
+{
+ mImpl->mOutlineSetByString = setByString;
+}
+
bool Controller::IsFontStyleSetByString()
{
return mImpl->mFontStyleSetByString;
bool Controller::IsFontStyleSetByString()
{
return mImpl->mFontStyleSetByString;
void ShadowSetByString( bool setByString );
/**
void ShadowSetByString( bool setByString );
/**
+ * @brief Query if outline settings were provided by string or map
+ * @return bool true if set by string
+ */
+ bool IsOutlineSetByString();
+
+ /**
+ * Set method outline setting were set by
+ * @param[in] bool, true if set by string
+ */
+ void OutlineSetByString( bool setByString );
+
+ /**
* @brief Query if font style settings were provided by string or map
* @return bool true if set by string
*/
* @brief Query if font style settings were provided by string or map
* @return bool true if set by string
*/
- if ( !propertiesMap.Empty() )
+ if ( propertiesMap.Empty() )
+ {
+ // Map empty so check if a string provided
+ // This is purely to maintain backward compatibility, but we don't parse the string to be a property map.
+ const std::string propertyString = value.Get<std::string>();
+
+ // Stores the default outline's properties string to be recovered by the GetOutlineProperties() function.
+ controller->SetDefaultOutlineProperties( propertyString );
+
+ controller->OutlineSetByString( true );
+ }
+ else
{
empty = ParseOutlineProperties( propertiesMap,
colorDefined,
color,
widthDefined,
width );
{
empty = ParseOutlineProperties( propertiesMap,
colorDefined,
color,
widthDefined,
width );
+
+ controller->OutlineSetByString( false );
{
case EffectStyle::DEFAULT:
{
{
case EffectStyle::DEFAULT:
{
- const Vector4& color = controller->GetOutlineColor();
- const float width = controller->GetOutlineWidth();
+ if ( controller->IsOutlineSetByString() )
+ {
+ value = controller->GetDefaultOutlineProperties();
+ break;
+ }
+ else
+ {
+ const Vector4& color = controller->GetOutlineColor();
+ const float width = controller->GetOutlineWidth();
- std::string colorStr;
- Vector4ToColorString( color, colorStr );
- map.Insert( COLOR_KEY, colorStr );
+ std::string colorStr;
+ Vector4ToColorString( color, colorStr );
+ map.Insert( COLOR_KEY, colorStr );
- std::string widthStr;
- FloatToString( width, widthStr );
- map.Insert( WIDTH_KEY, widthStr );
+ std::string widthStr;
+ FloatToString( width, widthStr );
+ map.Insert( WIDTH_KEY, widthStr );
}
case EffectStyle::INPUT:
{
}
case EffectStyle::INPUT:
{