X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-effects-style.cpp;h=2bf1398406f4ebaa6a1ec5d34128ba2fdeb401f0;hb=e4c8362431523550a745b190c67c0c8e3f25ac4d;hp=8d552d4b798644b99f844d6c8ac45124497e16ae;hpb=29a52105283ce8ced672ed92545daeacf882316a;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/text-effects-style.cpp b/dali-toolkit/internal/text/text-effects-style.cpp index 8d552d4..2bf1398 100644 --- a/dali-toolkit/internal/text/text-effects-style.cpp +++ b/dali-toolkit/internal/text/text-effects-style.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -18,11 +18,13 @@ // FILE HEADER #include +// EXTERNAL INCLUDES +#include + // INTERNAL INCLUDES #include -#include +#include #include -#include #include namespace Dali @@ -33,17 +35,16 @@ namespace Text { namespace { -const std::string COLOR_KEY("color"); -const std::string OFFSET_KEY("offset"); -const std::string BLUR_RADIUS_KEY("blurRadius"); -const std::string WIDTH_KEY("width"); -const std::string HEIGHT_KEY("height"); -const std::string ENABLE_KEY("enable"); -const std::string TYPE_KEY("type"); -const std::string DASH_WIDTH_KEY("dashWidth"); -const std::string DASH_GAP_KEY("dashGap"); -const std::string TRUE_TOKEN("true"); -const std::string FALSE_TOKEN("false"); +const char* COLOR_KEY = "color"; +const char* OFFSET_KEY = "offset"; +const char* BLUR_RADIUS_KEY = "blurRadius"; +const char* WIDTH_KEY = "width"; +const char* HEIGHT_KEY = "height"; +const char* ENABLE_KEY = "enable"; +const char* TYPE_KEY = "type"; +const char* DASH_WIDTH_KEY = "dashWidth"; +const char* DASH_GAP_KEY = "dashGap"; +const char* TRUE_TOKEN = "true"; } // namespace bool ParseShadowProperties(const Property::Map& shadowPropertiesMap, @@ -355,8 +356,8 @@ bool SetUnderlineProperties(ControllerPtr controller, const Property::Value& val { const Property::Map& propertiesMap = value.Get(); - bool enabled = false; - bool colorDefined = false; + bool enabled = false; + bool colorDefined = false; Vector4 color; bool heightDefined = false; float height = 0.f; @@ -611,7 +612,7 @@ bool SetShadowProperties(ControllerPtr controller, const Property::Value& value, update = true; } - if(blurRadiusDefined && (controller->GetShadowBlurRadius() != blurRadius)) + if(blurRadiusDefined && (!Dali::Equals(controller->GetShadowBlurRadius(), blurRadius))) { controller->SetShadowBlurRadius(blurRadius); update = true; @@ -976,11 +977,11 @@ bool SetStrikethroughProperties(ControllerPtr controller, const Property::Value& Text::ParsePropertyString(propertyString, parsedStringMap); empty = ParseStrikethroughProperties(parsedStringMap, - enabled, - colorDefined, - color, - heightDefined, - height); + enabled, + colorDefined, + color, + heightDefined, + height); controller->StrikethroughSetByString(!empty); } @@ -1057,7 +1058,7 @@ void GetStrikethroughProperties(ControllerPtr controller, Property::Value& value if(controller->IsStrikethroughSetByString()) { std::string strikethroughProperties = "{\"enable\":"; - const std::string enabledStr = enabled ? "true" : "false"; + const std::string enabledStr = enabled ? "true" : "false"; strikethroughProperties += "\"" + enabledStr + "\","; std::string colorStr; @@ -1092,6 +1093,17 @@ void GetStrikethroughProperties(ControllerPtr controller, Property::Value& value } } +Underline::Type StringToUnderlineType(const char* const underlineTypeStr) +{ + Underline::Type underlineType = Text::Underline::SOLID; + Scripting::GetEnumeration(underlineTypeStr, + UNDERLINE_TYPE_STRING_TABLE, + UNDERLINE_TYPE_STRING_TABLE_COUNT, + underlineType); + + return underlineType; +} + } // namespace Text } // namespace Toolkit