[Option Menu] FocusUi issue fix
authorvipul <vipul.kumar@samsung.com>
Thu, 4 Jul 2013 10:33:58 +0000 (16:03 +0530)
committervipul <vipul.kumar@samsung.com>
Thu, 4 Jul 2013 10:36:18 +0000 (16:06 +0530)
Signed-off-by: vipul <vipul.kumar@samsung.com>
Change-Id: Iaa649c2958e7145a8643b4abc147c86cbabcd017

src/ui/controls/FUiCtrl_OptionMenu.cpp

index 93bf204..0527d86 100644 (file)
@@ -239,13 +239,19 @@ _OptionMenu::OnFocusModeStateChanged(void)
 bool
 _OptionMenu::OnKeyPressed(const _Control &source, const _KeyInfo &keyInfo)
 {
-       if (&source != this)
+       _KeyCode keyCode = keyInfo.GetKeyCode();
+
+       if (!__isFocused)
        {
-               return false;
+               if (keyCode == _KEY_TAB)
+               {
+                       __isFocused = true;
+                       __currentFocusedIndex = 0;
+                       __pOptionMenuPresenter->DrawFocus(__currentFocusedIndex);
+               }
+               return true;
        }
 
-       _KeyCode keyCode = keyInfo.GetKeyCode();
-
        int height = 0;
        int dividerHeight = 0;
        int count = GetMaximumVisibleItemsCount();
@@ -254,11 +260,6 @@ _OptionMenu::OnKeyPressed(const _Control &source, const _KeyInfo &keyInfo)
        GET_SHAPE_CONFIG(OPTIONMENU::ITEM_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, height);
        GET_SHAPE_CONFIG(OPTIONMENU::LIST_DIVIDER_HEIGHT, _CONTROL_ORIENTATION_PORTRAIT, dividerHeight);
 
-       if (!__isFocused)
-       {
-               return false;
-       }
-
        switch (keyCode)
        {
        case _KEY_DOWN: