Revert "[Tizen]Add ClearFocusOnEscape to config section." 86/148986/1
authorHeeyong Song <heeyong.song@samsung.com>
Mon, 11 Sep 2017 08:49:22 +0000 (17:49 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 11 Sep 2017 08:49:29 +0000 (17:49 +0900)
This reverts commit 806cda4fa006cdea768c03d449f677d9964481d8.

Change-Id: Ibbda65c289c2e2e03601f929cdf7395fd8668da0

dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp
dali-toolkit/internal/controls/text-controls/text-field-impl.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h
dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json
dali-toolkit/styles/480x800/dali-toolkit-default-theme.json
dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json

index 333e8ec..ca6f5ab 100755 (executable)
@@ -1484,8 +1484,7 @@ bool TextEditor::OnKeyEvent( const KeyEvent& event )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor::OnKeyEvent %p keyCode %d\n", mController.Get(), event.keyCode );
 
-  if( Dali::DALI_KEY_ESCAPE == event.keyCode
-      && mController->IsClearFocusOnEscape() )
+  if( Dali::DALI_KEY_ESCAPE == event.keyCode ) // Make a Dali key code for this
   {
     // Make sure ClearKeyInputFocus when only key is up
     if( event.state == KeyEvent::Up )
index d73f170..1ed87bd 100644 (file)
@@ -1526,8 +1526,7 @@ bool TextField::OnKeyEvent( const KeyEvent& event )
 {
   DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnKeyEvent %p keyCode %d\n", mController.Get(), event.keyCode );
 
-  if( Dali::DALI_KEY_ESCAPE == event.keyCode
-      && mController->IsClearFocusOnEscape() )
+  if( Dali::DALI_KEY_ESCAPE == event.keyCode ) // Make a Dali key code for this
   {
     // Make sure ClearKeyInputFocus when only key is up
     if( event.state == KeyEvent::Up )
index 9c48ed1..054f4a7 100644 (file)
@@ -27,8 +27,6 @@
 #include <dali-toolkit/internal/text/text-controller.h>
 #include <dali-toolkit/internal/text/text-model.h>
 #include <dali-toolkit/internal/text/text-view.h>
-#include <dali-toolkit/public-api/styling/style-manager.h>
-#include <dali-toolkit/devel-api/styling/style-manager-devel.h>
 
 namespace Dali
 {
@@ -338,14 +336,6 @@ struct Controller::Impl
     // Set the text properties to default
     mModel->mVisualModel->SetUnderlineEnabled( false );
     mModel->mVisualModel->SetUnderlineHeight( 0.0f );
-
-    Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
-    if( styleManager )
-    {
-      Property::Map config = Toolkit::DevelStyleManager::GetConfigurations( styleManager );
-      mIsClearFocusOnEscape = config["clearFocusOnEscape"].Get<bool>();
-    }
-
   }
 
   ~Impl()
@@ -740,7 +730,6 @@ public:
   bool mUnderlineSetByString:1;            ///< Set when underline is set by string (legacy) instead of map
   bool mShadowSetByString:1;               ///< Set when shadow is set by string (legacy) instead of map
   bool mFontStyleSetByString:1;            ///< Set when font style is set by string (legacy) instead of map
-  bool mIsClearFocusOnEscape:1;            ///< Whether text control clear key input focus or not
 };
 
 } // namespace Text
index c7b8a59..8b0ee5b 100644 (file)
@@ -2222,10 +2222,13 @@ bool Controller::KeyEvent( const Dali::KeyEvent& keyEvent )
       // Do nothing.
       return false;
     }
-    else if( Dali::DALI_KEY_ESCAPE == keyCode || Dali::DALI_KEY_BACK )
+    else if( Dali::DALI_KEY_ESCAPE == keyCode )
     {
-      // Do nothing
-      return false;
+      // Escape key is a special case which causes focus loss
+      KeyboardFocusLostEvent();
+
+      // Will request for relayout.
+      relayoutNeeded = true;
     }
     else if( ( Dali::DALI_KEY_CURSOR_LEFT  == keyCode ) ||
              ( Dali::DALI_KEY_CURSOR_RIGHT == keyCode ) ||
@@ -3685,11 +3688,6 @@ void Controller::SetControlInterface( ControlInterface* controlInterface )
   mImpl->mControlInterface = controlInterface;
 }
 
-bool Controller::IsClearFocusOnEscape()
-{
-  return mImpl->mIsClearFocusOnEscape;
-}
-
 // private : Private contructors & copy operator.
 
 Controller::Controller()
index 0913cb5..5cb079c 100644 (file)
@@ -1180,13 +1180,6 @@ public: // Text-input Event Queuing.
    */
   void PasteClipboardItemEvent();
 
-  /**
-   * @brief Return whether text control clear key input focus or not when escape key is pressed.
-   *
-   * @return Whether text control clear key input focus or not
-   */
-  bool IsClearFocusOnEscape();
-
 protected: // Inherit from Text::Decorator::ControllerInterface.
 
   /**
index 50f9529..7debf95 100644 (file)
@@ -28,8 +28,7 @@
 {
   "config":
   {
-    "alwaysShowFocus":true,
-    "clearFocusOnEscape":false
+    "alwaysShowFocus":true
   },
   "styles":
   {
index 460d0f8..8612b3c 100644 (file)
@@ -28,8 +28,7 @@
 {
   "config":
   {
-    "alwaysShowFocus":false,
-    "clearFocusOnEscape":true
+    "alwaysShowFocus":false
   },
   "styles":
   {
index 9390546..0c48655 100644 (file)
@@ -28,8 +28,7 @@
 {
   "config":
   {
-    "alwaysShowFocus":false,
-    "clearFocusOnEscape":true
+    "alwaysShowFocus":false
   },
   "styles":
   {