/*
- * 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.
// FILE HEADER
#include <dali-toolkit/internal/text/text-effects-style.h>
+// EXTERNAL INCLUDES
+#include <dali/public-api/math/math-utils.h>
+
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/controls/text-controls/text-style-properties-devel.h>
-#include <dali-toolkit/internal/text/markup-processor-helper-functions.h>
+#include <dali-toolkit/internal/text/markup-processor/markup-processor-helper-functions.h>
#include <dali-toolkit/internal/text/property-string-parser.h>
-#include <dali-toolkit/public-api/text/text-enumerations.h>
#include <dali-toolkit/internal/text/text-enumerations-impl.h>
namespace Dali
{
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,
{
const Property::Map& propertiesMap = value.Get<Property::Map>();
- bool enabled = false;
- bool colorDefined = false;
+ bool enabled = false;
+ bool colorDefined = false;
Vector4 color;
bool heightDefined = false;
float height = 0.f;
update = true;
}
- if(blurRadiusDefined && (controller->GetShadowBlurRadius() != blurRadius))
+ if(blurRadiusDefined && (!Dali::Equals(controller->GetShadowBlurRadius(), blurRadius)))
{
controller->SetShadowBlurRadius(blurRadius);
update = true;
Text::ParsePropertyString(propertyString, parsedStringMap);
empty = ParseStrikethroughProperties(parsedStringMap,
- enabled,
- colorDefined,
- color,
- heightDefined,
- height);
+ enabled,
+ colorDefined,
+ color,
+ heightDefined,
+ height);
controller->StrikethroughSetByString(!empty);
}
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;
}
}
+Underline::Type StringToUnderlineType(const char* const underlineTypeStr)
+{
+ Underline::Type underlineType = Text::Underline::SOLID;
+ Scripting::GetEnumeration<Underline::Type>(underlineTypeStr,
+ UNDERLINE_TYPE_STRING_TABLE,
+ UNDERLINE_TYPE_STRING_TABLE_COUNT,
+ underlineType);
+
+ return underlineType;
+}
+
} // namespace Text
} // namespace Toolkit