From: Kamil Konieczny Date: Fri, 18 Sep 2020 10:53:39 +0000 (+0200) Subject: [AT-SPI] Add FOCUSABLE state to TextField and TextEditor X-Git-Tag: dali_2.0.0~6^2~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f7e4491acb379b6bde128d21ef0d9fefe77c3380;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git [AT-SPI] Add FOCUSABLE state to TextField and TextEditor Add FOCUSABLE state to TextField and TextEditor. Also while at this, add or remove FOCUSED depending on keyboard focus. Change-Id: I9bb0f68f3e3f521842c870ea099bae5617b7fc4d --- 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 5aa9ce2..7b4e8a2 100644 --- a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -2098,9 +2099,17 @@ bool TextEditor::AccessibleImpl::CutText( size_t startPosition, Dali::Accessibility::States TextEditor::AccessibleImpl::CalculateStates() { - auto states = Control::Impl::AccessibleImpl::CalculateStates(); using namespace Dali::Accessibility; + + auto states = Control::Impl::AccessibleImpl::CalculateStates(); states[State::EDITABLE] = true; + states[State::FOCUSABLE] = true; + + Toolkit::Control focusControl = Toolkit::KeyInputFocusManager::Get().GetCurrentFocusControl(); + if (self == focusControl) + { + states[State::FOCUSED] = true; + } return states; } 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 0c9f544..1d79c5f 100644 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp @@ -2036,9 +2036,19 @@ bool TextField::AccessibleImpl::CutText( size_t startPosition, Dali::Accessibility::States TextField::AccessibleImpl::CalculateStates() { - auto states = Control::Impl::AccessibleImpl::CalculateStates(); using namespace Dali::Accessibility; + + auto states = Control::Impl::AccessibleImpl::CalculateStates(); + states[State::EDITABLE] = true; + states[State::FOCUSABLE] = true; + + Toolkit::Control focusControl = Toolkit::KeyInputFocusManager::Get().GetCurrentFocusControl(); + if (self == focusControl) + { + states[State::FOCUSED] = true; + } + return states; }