Fix for jira N_se-47093
authorvipul <vipul.kumar@samsung.com>
Wed, 24 Jul 2013 13:31:18 +0000 (19:01 +0530)
committervipul <vipul.kumar@samsung.com>
Thu, 25 Jul 2013 13:12:59 +0000 (18:42 +0530)
Signed-off-by: vipul <vipul.kumar@samsung.com>
Change-Id: I0e0f8b813325f99c3e569fd16710498da49c93fc

src/ui/controls/FUiCtrl_ContextMenuListPresenter.cpp
src/ui/inc/FUi_ResourceContextMenuConfig.h
src/ui/resource/FUi_ResourceContextMenuConfig.cpp

index 7de0873..21a608f 100644 (file)
@@ -470,6 +470,9 @@ _ContextMenuListPresenter::CalculateRect(void)
        float screenLeftMargin = __screenLeftMargin;
        float screenRightMargin = __screenRightMargin;
 
+       int scrollPanelMargin;
+       GET_SHAPE_CONFIG(CONTEXTMENU::SCROLL_PANEL_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, scrollPanelMargin);
+
        FloatPoint anchorPosition = __pContextMenu->GetAnchorPosition();
        FloatDimension screen = _ControlManager::GetInstance()->GetScreenSizeF();
 
@@ -502,7 +505,7 @@ _ContextMenuListPresenter::CalculateRect(void)
        AdjustItemLayout();
 
        bodyRect.width = __layoutSize.width + bodyLeftMargin + bodyRightMargin;
-       bodyRect.height = __layoutSize.height + bodyTopMargin + bodyBottomMargin;
+       bodyRect.height = __layoutSize.height + bodyTopMargin + bodyBottomMargin + 2 * scrollPanelMargin;
 
        // calculate the position of the arrow and body rect.
        if (dropPosition == CONTEXT_MENU_CORE_DROP_POSITION_UP)   // down Arrow
@@ -746,7 +749,7 @@ _ContextMenuListPresenter::CalculateRect(void)
        }
 
        itemRect.x      = bodyRect.x + bodyLeftMargin;
-       itemRect.y      = bodyRect.y + bodyTopMargin;
+       itemRect.y      = bodyRect.y + bodyTopMargin + scrollPanelMargin;
        itemRect.width  = __layoutSize.width;
        itemRect.height = __layoutSize.height;
 
@@ -759,14 +762,12 @@ _ContextMenuListPresenter::CalculateRect(void)
        // _Scroll visual interaction if Bounds < ScrollAreaBounds
        if (__pContextMenu->IsVisible())
        {
-               int itemTopMargin;
-               GET_SHAPE_CONFIG(CONTEXTMENU::ITEM_BG_PRESSED_MARGIN, _CONTROL_ORIENTATION_PORTRAIT, itemTopMargin);
-               __pContextMenu->GetScrollPanel()->SetBounds(FloatRectangle(bodyRect.x + bodyLeftMargin, bodyRect.y + bodyTopMargin + itemTopMargin,
-                               __layoutSize.width, __layoutSize.height - 2 * itemTopMargin));
+               __pContextMenu->GetScrollPanel()->SetBounds(FloatRectangle(bodyRect.x + bodyLeftMargin, bodyRect.y + bodyTopMargin + scrollPanelMargin,
+                               __layoutSize.width, __layoutSize.height));
                int itemCount = __pModel->GetItemCount();
                float itemHeight = __itemHeight + (__dividerHeight * 2.0f);
                float layoutClientHeight = itemCount * itemHeight - (__dividerHeight * 2.0f);
-               __pContextMenu->GetScrollPanel()->SetClientAreaHeight(layoutClientHeight - 2 * itemTopMargin);
+               __pContextMenu->GetScrollPanel()->SetClientAreaHeight(layoutClientHeight);
        }
 
        __pContextMenu->SetMovable(true);
index cb08c2a..3aed6d9 100644 (file)
@@ -90,6 +90,7 @@ DECLARE_UI_CONFIG(CONTEXTMENU);
        DECLARE_SHAPE_CONFIG(ITEM_BG_PRESSED_MARGIN, 43);
        DECLARE_SHAPE_CONFIG(ANCHOR_POPUP_OVERLAP, 44);
        DECLARE_SHAPE_CONFIG(LIST_TEXT_GAP, 45);
+       DECLARE_SHAPE_CONFIG(SCROLL_PANEL_MARGIN, 46);
        DECLARE_FIXED_VALUE_CONFIG(GRID_ITEM_GAP, 1);
 DECLARE_END_UI_CONFIG(CONTEXTMENU);
 
index 4515c3d..dc9db74 100644 (file)
@@ -114,6 +114,7 @@ START_UI_CONFIG(CONTEXTMENU);
                ADD_SHAPE_CONFIG(ANCHOR_POPUP_OVERLAP, 1);
 
                ADD_SHAPE_CONFIG(LIST_TEXT_GAP, 20);
+               ADD_SHAPE_CONFIG(SCROLL_PANEL_MARGIN, 4);
        END_UI_CONFIG_MODE(720x1280);
 
        START_UI_CONFIG_MODE(1280x720);