Fix for jira N_SE 45854 and N_SE 45823
authorvipul <vipul.kumar@samsung.com>
Mon, 15 Jul 2013 08:43:34 +0000 (14:13 +0530)
committervipul <vipul.kumar@samsung.com>
Mon, 15 Jul 2013 09:20:56 +0000 (14:50 +0530)
Signed-off-by: vipul <vipul.kumar@samsung.com>
Change-Id: Iec500adf3d902601d1e3168cc890e9292e7c23bf

src/ui/controls/FUiCtrl_ContextMenu.cpp

index adb2f85..b06d8aa 100644 (file)
@@ -24,6 +24,7 @@
 #include <FGrp_BitmapImpl.h>
 #include <FBaseColIEnumeratorT.h>
 #include "FUi_ControlImplManager.h"
+#include "FUi_EcoreEvasMgr.h"
 #include "FUi_ResourceManager.h"
 #include "FUi_KeyEventManager.h"
 #include "FUiAnim_VisualElement.h"
@@ -290,9 +291,8 @@ _ContextMenu::OnAttachedToMainTree(void)
 {
        result r = E_SUCCESS;
 
-       __layout = _ControlManager::GetInstance()->GetOrientation();
-       __rotation = _ControlManager::GetInstance()->GetScreenRotation();
        __isAttachedToMainTree = true;
+
        _Control* pOwner = GetOwner();
        if (pOwner == null)
        {
@@ -302,6 +302,8 @@ _ContextMenu::OnAttachedToMainTree(void)
                _Form* pForm = pFrame->GetCurrentForm();
                pForm != null ? SetOwner(pForm) : SetOwner(pFrame);
 
+               pOwner = GetOwner();
+
                GET_SHAPE_CONFIG(CONTEXTMENU::ITEM_MAX_COUNT, __layout, __showItemMaxCount);
        }
        else
@@ -309,6 +311,37 @@ _ContextMenu::OnAttachedToMainTree(void)
                pOwner->LockInputEvent();
        }
 
+       __layout = pOwner->GetOrientation();
+
+       _Window* pOwnerWindow = pOwner->GetRootWindow();
+
+       if (pOwnerWindow != null)
+       {
+               int ownerRotation = GetEcoreEvasMgr()->GetEcoreEvas()->GetWindowRotation(*pOwnerWindow);
+               switch (ownerRotation)
+               {
+               case 0:
+                       __rotation = _CONTROL_ROTATION_0;
+                       break;
+
+               case 90:
+                       __rotation = _CONTROL_ROTATION_90;
+                       break;
+
+               case 180:
+                       __rotation = _CONTROL_ROTATION_180;
+                       break;
+
+               case 270:
+                       __rotation = _CONTROL_ROTATION_270;
+                       break;
+
+               default:
+                       __rotation = _CONTROL_ROTATION_0;
+                       break;
+               }
+       }
+
        AdjustDropPosition();
 
        if (GetItemCount() <= 0)