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=04a50828dac02aea6a94773c50d92c97f6e55410;hb=HEAD;hpb=2b6e7d59a00075e2f83eedee483e3544a7af7f3d 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 04a5082..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: @@ -507,6 +509,15 @@ void TextField::PropertyHandler::SetProperty(Toolkit::TextField textField, Prope if(map) { impl.mController->SetHiddenInputOption(*map); + auto mode = map->Find(Toolkit::HiddenInput::Property::MODE); + if(mode && (mode->Get() != Toolkit::HiddenInput::Mode::HIDE_NONE)) + { + textField.SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_ROLE, Accessibility::Role::PASSWORD_TEXT); + } + else + { + textField.SetProperty(Toolkit::DevelControl::Property::ACCESSIBILITY_ROLE, Accessibility::Role::ENTRY); + } } break; } @@ -615,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()); @@ -654,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; + } } } @@ -992,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()); @@ -1014,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; }