From: vipul Date: Mon, 15 Jul 2013 08:43:34 +0000 (+0530) Subject: Fix for jira N_SE 45854 and N_SE 45823 X-Git-Tag: submit/tizen_2.2/20130716.173726~23^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4bc4cf270791f73d36f80896e34e958676a36f89;p=framework%2Fosp%2Fuifw.git Fix for jira N_SE 45854 and N_SE 45823 Signed-off-by: vipul Change-Id: Iec500adf3d902601d1e3168cc890e9292e7c23bf --- diff --git a/src/ui/controls/FUiCtrl_ContextMenu.cpp b/src/ui/controls/FUiCtrl_ContextMenu.cpp index adb2f85..b06d8aa 100644 --- a/src/ui/controls/FUiCtrl_ContextMenu.cpp +++ b/src/ui/controls/FUiCtrl_ContextMenu.cpp @@ -24,6 +24,7 @@ #include #include #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)