Fix Focused control when AncestorVisibleState is changed
authorkeonpyo.kong <keonpyo.kong@samsung.com>
Tue, 16 Apr 2013 04:40:28 +0000 (13:40 +0900)
committerkeonpyo.kong <keonpyo.kong@samsung.com>
Tue, 16 Apr 2013 04:40:37 +0000 (13:40 +0900)
Change-Id: Ia42e3a905e946950b593eab1ebcb83cbdf274e84
Signed-off-by: keonpyo.kong <keonpyo.kong@samsung.com>
src/ui/FUi_Control.cpp
src/ui/controls/FUiCtrl_Toolbar.cpp

index f02801b..a900e51 100644 (file)
@@ -881,6 +881,11 @@ _Control::OnVisibleStateChanged(void)
 void\r
 _Control::OnAncestorVisibleStateChanged(const _Control& control)\r
 {\r
+       _Control* pControl = GetFocused();\r
+       if (pControl == this)\r
+       {\r
+               SetFocused(false);\r
+       }       \r
 }\r
 \r
 void\r
@@ -2842,6 +2847,20 @@ _Control::SetVisibleState(bool visibleState)
 \r
        if (visibleState == false)\r
        {\r
+               _Window* pTop = GetRootWindow();\r
+               if (pTop)\r
+               {\r
+                       if ((this) == pTop->GetFocusedControl())\r
+                       {\r
+                               pTop->SetFocusedControl(null);\r
+                       }\r
+               }\r
+\r
+               _Control* pControl = GetFocused();\r
+               if (pControl == this)\r
+               {\r
+                       SetFocused(false);\r
+               }\r
                int owneeCount = GetOwneeCount();\r
                for (int i = 0; i < owneeCount; ++i)\r
                {\r
index 0434312..aec32e3 100644 (file)
@@ -2899,6 +2899,7 @@ _Toolbar::OnAncestorVisibleStateChanged(const _Control& control)
 {
        __pToolbarPresenter->OnAncestorVisibleStateChanged(control);
 
+       _Control::OnAncestorVisibleStateChanged(control);
        return;
 }