From: Joogab Yun Date: Thu, 8 Jul 2021 09:28:50 +0000 (+0900) Subject: Revert "Call SetCurrentFocusActor()" X-Git-Tag: dali_2.0.34~2^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=0941ae965825d0037923ec0867635bd098fc0675;ds=sidebyside Revert "Call SetCurrentFocusActor()" Change-Id: I4a3e0a68ae3e93ead855ab21e1ee33067ae2e2c9 --- diff --git a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp index 4f8dd66..72503a5 100644 --- a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -1205,10 +1204,7 @@ void TextEditor::SelectWholeText() if(mController && mController->IsShowingRealText()) { mController->SelectWholeText(); - if(!Self().GetProperty(Actor::Property::KEYBOARD_FOCUSABLE) || !Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self())) - { - SetKeyInputFocus(); - } + SetKeyInputFocus(); } } @@ -1756,10 +1752,7 @@ void TextEditor::OnTap(const TapGesture& gesture) mController->TapEvent(gesture.GetNumberOfTaps(), localPoint.x - padding.start, localPoint.y - padding.top); mController->AnchorEvent(localPoint.x - padding.start, localPoint.y - padding.top); - if(!Self().GetProperty(Actor::Property::KEYBOARD_FOCUSABLE) || !Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self())) - { - SetKeyInputFocus(); - } + SetKeyInputFocus(); } void TextEditor::OnPan(const PanGesture& gesture) @@ -1778,10 +1771,7 @@ void TextEditor::OnLongPress(const LongPressGesture& gesture) const Vector2& localPoint = gesture.GetLocalPoint(); mController->LongPressEvent(gesture.GetState(), localPoint.x - padding.start, localPoint.y - padding.top); - if(!Self().GetProperty(Actor::Property::KEYBOARD_FOCUSABLE) || !Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self())) - { - SetKeyInputFocus(); - } + SetKeyInputFocus(); } bool TextEditor::OnKeyEvent(const KeyEvent& event) @@ -1945,10 +1935,7 @@ void TextEditor::SetTextSelectionRange(const uint32_t* start, const uint32_t* en if(mController && mController->IsShowingRealText()) { mController->SetTextSelectionRange(start, end); - if(!Self().GetProperty(Actor::Property::KEYBOARD_FOCUSABLE) || !Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self())) - { - SetKeyInputFocus(); - } + SetKeyInputFocus(); } } @@ -2266,10 +2253,10 @@ bool TextEditor::AccessibleImpl::SetCursorOffset(size_t offset) return true; } -Dali::Accessibility::Range TextEditor::AccessibleImpl::GetTextAtOffset(size_t offset, Dali::Accessibility::TextBoundary boundary) +Dali::Accessibility::Range TextEditor::AccessibleImpl::GetTextAtOffset( size_t offset, Dali::Accessibility::TextBoundary boundary) { - auto self = Toolkit::TextEditor::DownCast(Self()); - auto text = self.GetProperty(Toolkit::TextEditor::Property::TEXT).Get(); + auto self = Toolkit::TextEditor::DownCast(Self()); + auto text = self.GetProperty(Toolkit::TextEditor::Property::TEXT).Get(); auto textSize = text.size(); auto range = Dali::Accessibility::Range{}; @@ -2290,7 +2277,7 @@ Dali::Accessibility::Range TextEditor::AccessibleImpl::GetTextAtOffset(size_t of case Dali::Accessibility::TextBoundary::LINE: { auto textString = text.c_str(); - auto breaks = std::vector(textSize, 0); + auto breaks = std::vector(textSize, 0); if(boundary == Dali::Accessibility::TextBoundary::WORD) { @@ -2365,8 +2352,8 @@ Dali::Accessibility::Range TextEditor::AccessibleImpl::GetRangeOfSelection(size_ return {}; } - auto self = Toolkit::TextEditor::DownCast(Self()); - auto controller = Dali::Toolkit::GetImpl(self).GetTextController(); + auto self = Toolkit::TextEditor::DownCast(Self()); + auto controller = Dali::Toolkit::GetImpl(self).GetTextController(); std::string value{}; controller->RetrieveSelection(value); auto indices = controller->GetSelectionIndexes(); @@ -2449,7 +2436,7 @@ Dali::Accessibility::States TextEditor::AccessibleImpl::CalculateStates() { using namespace Dali::Accessibility; - auto states = DevelControl::AccessibleImpl::CalculateStates(); + auto states = DevelControl::AccessibleImpl::CalculateStates(); states[State::EDITABLE] = true; states[State::FOCUSABLE] = true; @@ -2464,7 +2451,7 @@ Dali::Accessibility::States TextEditor::AccessibleImpl::CalculateStates() bool TextEditor::AccessibleImpl::InsertText(size_t startPosition, std::string text) { - auto self = Toolkit::TextEditor::DownCast(Self()); + auto self = Toolkit::TextEditor::DownCast(Self()); auto insertedText = self.GetProperty(Toolkit::TextEditor::Property::TEXT).Get(); insertedText.insert(startPosition, text); diff --git a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp index 1e87035..b1a85c7 100644 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -1150,10 +1149,7 @@ void TextField::SelectWholeText() if(mController && mController->IsShowingRealText()) { mController->SelectWholeText(); - if(!Self().GetProperty(Actor::Property::KEYBOARD_FOCUSABLE) || !Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self())) - { - SetKeyInputFocus(); - } + SetKeyInputFocus(); } } @@ -1180,10 +1176,7 @@ void TextField::SetTextSelectionRange(const uint32_t* start, const uint32_t* end if(mController && mController->IsShowingRealText()) { mController->SetTextSelectionRange(start, end); - if(!Self().GetProperty(Actor::Property::KEYBOARD_FOCUSABLE) || !Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self())) - { - SetKeyInputFocus(); - } + SetKeyInputFocus(); } } @@ -1673,10 +1666,7 @@ void TextField::OnTap(const TapGesture& gesture) mController->TapEvent(gesture.GetNumberOfTaps(), localPoint.x - padding.start, localPoint.y - padding.top); mController->AnchorEvent(localPoint.x - padding.start, localPoint.y - padding.top); - if(!Self().GetProperty(Actor::Property::KEYBOARD_FOCUSABLE) || !Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self())) - { - SetKeyInputFocus(); - } + SetKeyInputFocus(); } void TextField::OnPan(const PanGesture& gesture) @@ -1695,10 +1685,7 @@ void TextField::OnLongPress(const LongPressGesture& gesture) const Vector2& localPoint = gesture.GetLocalPoint(); mController->LongPressEvent(gesture.GetState(), localPoint.x - padding.start, localPoint.y - padding.top); - if(!Self().GetProperty(Actor::Property::KEYBOARD_FOCUSABLE) || !Toolkit::KeyboardFocusManager::Get().SetCurrentFocusActor(Self())) - { - SetKeyInputFocus(); - } + SetKeyInputFocus(); } bool TextField::OnKeyEvent(const KeyEvent& event) @@ -2056,8 +2043,8 @@ bool TextField::AccessibleImpl::SetCursorOffset(size_t offset) Dali::Accessibility::Range TextField::AccessibleImpl::GetTextAtOffset( size_t offset, Dali::Accessibility::TextBoundary boundary) { - auto self = Toolkit::TextField::DownCast(Self()); - auto text = self.GetProperty(Toolkit::TextField::Property::TEXT).Get(); + auto self = Toolkit::TextField::DownCast(Self()); + auto text = self.GetProperty(Toolkit::TextField::Property::TEXT).Get(); auto textSize = text.size(); auto range = Dali::Accessibility::Range{}; @@ -2078,7 +2065,7 @@ Dali::Accessibility::Range TextField::AccessibleImpl::GetTextAtOffset( case Dali::Accessibility::TextBoundary::LINE: { auto textString = text.c_str(); - auto breaks = std::vector(textSize, 0); + auto breaks = std::vector(textSize, 0); if(boundary == Dali::Accessibility::TextBoundary::WORD) { @@ -2153,8 +2140,8 @@ Dali::Accessibility::Range TextField::AccessibleImpl::GetRangeOfSelection(size_t return {}; } - auto self = Toolkit::TextField::DownCast(Self()); - auto controller = Dali::Toolkit::GetImpl(self).GetTextController(); + auto self = Toolkit::TextField::DownCast(Self()); + auto controller = Dali::Toolkit::GetImpl(self).GetTextController(); std::string value{}; controller->RetrieveSelection(value); auto indices = controller->GetSelectionIndexes(); @@ -2253,7 +2240,7 @@ Dali::Accessibility::States TextField::AccessibleImpl::CalculateStates() bool TextField::AccessibleImpl::InsertText(size_t startPosition, std::string text) { - auto self = Toolkit::TextField::DownCast(Self()); + auto self = Toolkit::TextField::DownCast(Self()); auto insertedText = self.GetProperty(Toolkit::TextField::Property::TEXT).Get(); insertedText.insert(startPosition, text);