X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftext-controls%2Ftext-field-property-handler.cpp;h=45af9b7ad68466d00028e68ec3135449379c5cc6;hp=db08d3aed9ca8998498f8be501c9b7e52eeb6d05;hb=HEAD;hpb=bad241077bd728d9a5ef25d59398eae889b359a1 diff --git a/dali-toolkit/internal/controls/text-controls/text-field-property-handler.cpp b/dali-toolkit/internal/controls/text-controls/text-field-property-handler.cpp index db08d3ae..5151ef1 100644 --- a/dali-toolkit/internal/controls/text-controls/text-field-property-handler.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-field-property-handler.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. @@ -14,13 +14,14 @@ * limitations under the License. */ +#include #include #include #include #include -#include +#include #include #include #include @@ -408,6 +409,7 @@ void TextField::PropertyHandler::SetProperty(Toolkit::TextField textField, Prope DALI_LOG_INFO(gTextFieldLogFilter, Debug::General, "TextField %p ENABLE_MARKUP %d\n", impl.mController.Get(), enableMarkup); impl.mController->SetMarkupProcessorEnabled(enableMarkup); + CommonTextUtils::SynchronizeTextAnchorsInParent(textField, impl.mController, impl.mAnchorActors); break; } case Toolkit::TextField::Property::INPUT_FONT_FAMILY: @@ -624,6 +626,15 @@ void TextField::PropertyHandler::SetProperty(Toolkit::TextField textField, Prope } break; } + case Toolkit::DevelTextField::Property::ENABLE_FONT_SIZE_SCALE: + { + const bool enableFontSizeScale = value.Get(); + if(!Equals(impl.mController->IsFontSizeScaleEnabled(), enableFontSizeScale)) + { + impl.mController->SetFontSizeScaleEnabled(enableFontSizeScale); + } + break; + } case Toolkit::DevelTextField::Property::PRIMARY_CURSOR_POSITION: { uint32_t position = static_cast(value.Get()); @@ -663,6 +674,53 @@ void TextField::PropertyHandler::SetProperty(Toolkit::TextField textField, Prope } break; } + case Toolkit::DevelTextField::Property::STRIKETHROUGH: + { + const bool update = SetStrikethroughProperties(impl.mController, value, Text::EffectStyle::DEFAULT); + if(update) + { + impl.mRenderer.Reset(); + } + break; + } + case Toolkit::DevelTextField::Property::INPUT_STRIKETHROUGH: + { + const bool update = SetStrikethroughProperties(impl.mController, value, Text::EffectStyle::INPUT); + if(update) + { + impl.mRenderer.Reset(); + } + break; + } + case Toolkit::DevelTextField::Property::CHARACTER_SPACING: + { + const float characterSpacing = value.Get(); + DALI_LOG_INFO(gTextFieldLogFilter, Debug::General, "TextField %p CHARACTER_SPACING %d\n", impl.mController.Get(), characterSpacing); + + impl.mController->SetCharacterSpacing(characterSpacing); + break; + } + case Toolkit::DevelTextField::Property::SELECTION_POPUP_STYLE: + { + const Property::Map* map = value.GetMap(); + if(map) + { + impl.mDecorator->SetSelectionPopupStyle(*map); + } + break; + } + case Toolkit::DevelTextField::Property::REMOVE_FRONT_INSET: + { + const bool remove = value.Get(); + impl.mController->SetRemoveFrontInset(remove); + break; + } + case Toolkit::DevelTextField::Property::REMOVE_BACK_INSET: + { + const bool remove = value.Get(); + impl.mController->SetRemoveBackInset(remove); + break; + } } } @@ -1001,6 +1059,11 @@ Property::Value TextField::PropertyHandler::GetProperty(Toolkit::TextField textF value = impl.mController->GetFontSizeScale(); break; } + case Toolkit::DevelTextField::Property::ENABLE_FONT_SIZE_SCALE: + { + value = impl.mController->IsFontSizeScaleEnabled(); + break; + } case Toolkit::DevelTextField::Property::PRIMARY_CURSOR_POSITION: { value = static_cast(impl.mController->GetPrimaryCursorPosition()); @@ -1023,6 +1086,39 @@ Property::Value TextField::PropertyHandler::GetProperty(Toolkit::TextField textF value = impl.mController->GetEllipsisPosition(); break; } + case Toolkit::DevelTextField::Property::STRIKETHROUGH: + { + GetStrikethroughProperties(impl.mController, value, Text::EffectStyle::DEFAULT); + break; + } + case Toolkit::DevelTextField::Property::INPUT_STRIKETHROUGH: + { + GetStrikethroughProperties(impl.mController, value, Text::EffectStyle::INPUT); + break; + } + case Toolkit::DevelTextField::Property::CHARACTER_SPACING: + { + value = impl.mController->GetCharacterSpacing(); + break; + } + case Toolkit::DevelTextField::Property::SELECTION_POPUP_STYLE: + { + Property::Map map; + impl.mDecorator->GetSelectionPopupStyle(map); + value = map; + break; + } + case Toolkit::DevelTextField::Property::REMOVE_FRONT_INSET: + { + value = impl.mController->IsRemoveFrontInset(); + break; + } + case Toolkit::DevelTextField::Property::REMOVE_BACK_INSET: + { + value = impl.mController->IsRemoveBackInset(); + break; + } + } //switch return value; }