Fix for N_SE-56725.
authorsriram.k <sriram.k@samsung.com>
Thu, 31 Oct 2013 05:05:01 +0000 (10:35 +0530)
committersriram.k <sriram.k@samsung.com>
Thu, 31 Oct 2013 10:03:36 +0000 (15:33 +0530)
Signed-off-by: sriram.k <sriram.k@samsung.com>
Change-Id: I4c38a344c42037d350bd5180731bcbb75f7de446

src/ui/controls/FUiCtrl_ContextMenu.cpp
src/ui/controls/FUiCtrl_ContextMenuGridPresenter.cpp
src/ui/controls/FUiCtrl_ContextMenuListPresenter.cpp
src/ui/controls/FUiCtrl_OptionMenu.cpp
src/ui/controls/FUiCtrl_OptionMenuPresenter.cpp
src/ui/inc/FUiCtrl_ContextMenu.h
src/ui/inc/FUiCtrl_OptionMenu.h

index 4e1b9c2..2e6f1d8 100644 (file)
@@ -391,8 +391,6 @@ _ContextMenu::OnAttachedToMainTree(void)
 
        GetEcoreEvasMgr()->GetEcoreEvas()->SetWindowBounds(*this, GetBoundsF());
 
-       SetAllAccessibilityElement();
-
        _VisualElement* pVisualElement = GetVisualElement();
        FloatRectangle pBounds = pVisualElement->GetBounds();
        float oldBoundsX = pBounds.x;
index 47d0552..991d43d 100644 (file)
@@ -426,6 +426,7 @@ _ContextMenuGridPresenter::CalculateWindowRect(void)
        SysTryReturnResult(NID_UI_CTRL, r == E_SUCCESS, r, "Propagating.");
 
        AdjustItemPosition();
+       SetAllAccessibilityElement();
 
        return r;
 }
@@ -1911,7 +1912,7 @@ _ContextMenuGridPresenter::SetAllAccessibilityElement(void)
                pElementContextMenu->SetTraitWithStringId("IDS_TPLATFORM_BODY_CONTEXTUAL_POP_UP_T_TTS");
                pElementContextMenu->SetHintWithStringId("IDS_TPLATFORM_BODY_CONTEXTUAL_POP_UP_IS_OPEN_DOUBLE_TAP_TO_CLOSE_THE_POP_UP_T_TTS");
 
-               pElementContextMenu->SetBounds(FloatRectangle(0.0f, 0.0f, __pContextMenu->GetBoundsF().width, __pContextMenu->GetBoundsF().height));
+               pElementContextMenu->SetBounds(FloatRectangle(__pContextMenu->GetItemRect().x, __pContextMenu->GetItemRect().y, __pContextMenu->GetItemRect().width, __pContextMenu->GetItemRect().height));
                pContainer->AddElement(*pElementContextMenu);
                __pContextMenu->AddAccessibilityElement(*pElementContextMenu);
 
index 69966f9..539fe01 100644 (file)
@@ -435,6 +435,7 @@ _ContextMenuListPresenter::CalculateWindowRect(void)
 {
        result r = CalculateRect();
        AdjustItemPosition();
+       SetAllAccessibilityElement();
 
        return r;
 }
@@ -1458,6 +1459,9 @@ _ContextMenuListPresenter::OnFontInfoRequested(unsigned long& style, float& size
 void
 _ContextMenuListPresenter::SetAllAccessibilityElement(void)
 {
+       int scrollPanelMargin;
+       GET_SHAPE_CONFIG(CONTEXTMENU::SCROLL_PANEL_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, scrollPanelMargin);
+
        _AccessibilityContainer* pContainerContextMenu = __pContextMenu->GetAccessibilityContainer();
        if (pContainerContextMenu != null)
        {
@@ -1467,7 +1471,7 @@ _ContextMenuListPresenter::SetAllAccessibilityElement(void)
                pElementContextMenu->SetSupportOperatingGesture(false);
                pElementContextMenu->SetTraitWithStringId("IDS_TPLATFORM_BODY_CONTEXTUAL_POP_UP_T_TTS");
                pElementContextMenu->SetHintWithStringId("IDS_TPLATFORM_BODY_CONTEXTUAL_POP_UP_IS_OPEN_DOUBLE_TAP_TO_CLOSE_THE_POP_UP_T_TTS");
-               pElementContextMenu->SetBounds(FloatRectangle(0.0f, 0.0f, __pContextMenu->GetBoundsF().width, __pContextMenu->GetBoundsF().height));
+               pElementContextMenu->SetBounds(FloatRectangle(__pContextMenu->GetItemRect().x, __pContextMenu->GetItemRect().y - scrollPanelMargin, __pContextMenu->GetItemRect().width, __pContextMenu->GetItemRect().height + 2 * scrollPanelMargin));
                pContainerContextMenu->AddElement(*pElementContextMenu);
                __pContextMenu->AddAccessibilityElement(*pElementContextMenu);
 
index 12d5f2c..54fc725 100644 (file)
@@ -549,8 +549,6 @@ _OptionMenu::OnAttachedToMainTree(void)
 
        GetEcoreEvasMgr()->GetEcoreEvas()->SetWindowBounds(*this, GetBoundsF());
 
-       SetAllAccessibilityElement();
-
        OpenAnimation();
 
        return _Window::OnAttachedToMainTree();
index 1c24548..57d8b25 100644 (file)
@@ -587,6 +587,7 @@ _OptionMenuPresenter::CalculateWindowRect(void)
 {
        result r = CalculateRect();
        AdjustItemPosition();
+       __pOptionMenu->SetAllAccessibilityElement();
 
        return r;
 }
@@ -1087,6 +1088,9 @@ _OptionMenuPresenter::OnFontInfoRequested(unsigned long& style, float& size)
 void
 _OptionMenuPresenter::SetAllAccessibilityElement(void)
 {
+       int scrollPanelMargin;
+       GET_SHAPE_CONFIG(CONTEXTMENU::SCROLL_PANEL_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, scrollPanelMargin);
+
        _AccessibilityContainer* pContainerOptionMenu = __pOptionMenu->GetAccessibilityContainer();
        if (pContainerOptionMenu != null)
        {
@@ -1096,7 +1100,7 @@ _OptionMenuPresenter::SetAllAccessibilityElement(void)
                pElementOptionMenu->SetSupportOperatingGesture(false);
                //pElementOptionMenu->SetTraitWithStringId("IDS_TPLATFORM_BODY_CONTEXTUAL_POP_UP_T_TTS");
                pElementOptionMenu->SetHintWithStringId("IDS_TPLATFORM_BODY_CONTEXTUAL_POP_UP_IS_OPEN_DOUBLE_TAP_TO_CLOSE_THE_POP_UP_T_TTS");
-               pElementOptionMenu->SetBounds(FloatRectangle(0.0f, 0.0f, __pOptionMenu->GetBoundsF().width, __pOptionMenu->GetBoundsF().height));
+               pElementOptionMenu->SetBounds(FloatRectangle(__pOptionMenu->GetItemRect().x, __pOptionMenu->GetItemRect().y - scrollPanelMargin, __pOptionMenu->GetItemRect().width, __pOptionMenu->GetItemRect().height + 2* scrollPanelMargin));
                pContainerOptionMenu->AddElement(*pElementOptionMenu);
                __pOptionMenu->AddAccessibilityElement(*pElementOptionMenu);
 
index 51ccafd..d68a911 100644 (file)
@@ -234,6 +234,7 @@ public:
 
        Tizen::Ui::_AccessibilityElement* GetAccessibilityElement(const int mainIndex) const;
        void AddAccessibilityElement(const _AccessibilityElement& element);
+       void SetAllAccessibilityElement(void);
 
        _ContextMenuItemInfo GetItemFromPosition(const Tizen::Graphics::FloatPoint& position) const;
        _ContextMenuItemInfo FindItem(int index) const;
@@ -248,7 +249,6 @@ private:
        result LoadBitmap(void);
        result LoadColorReplacedBitmap(const Tizen::Graphics::Color& color);
        void AdjustDropPosition(void);
-       void SetAllAccessibilityElement(void);
        void RemoveAllAccessibilityElement(void);
 
 private:
index 351c071..747ae76 100644 (file)
@@ -208,6 +208,7 @@ public:
 
        Tizen::Ui::_AccessibilityElement* GetAccessibilityElement(const int mainIndex) const;
        void AddAccessibilityElement(const _AccessibilityElement& element);
+       void SetAllAccessibilityElement(void);
 
        _OptionMenuItemInfo GetItemFromPosition(const Tizen::Graphics::FloatPoint& position) const;
        _OptionMenuItemInfo FindItem(int index) const;
@@ -228,7 +229,6 @@ protected:
 private:
        result LoadBitmap(void);
        result LoadColorReplacedBitmap(const Tizen::Graphics::Color& color);
-       void SetAllAccessibilityElement(void);
        void RemoveAllAccessibilityElement(void);
 
        _OptionMenu(const _OptionMenu& rhs);