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();
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
}
itemRect.x = bodyRect.x + bodyLeftMargin;
- itemRect.y = bodyRect.y + bodyTopMargin;
+ itemRect.y = bodyRect.y + bodyTopMargin + scrollPanelMargin;
itemRect.width = __layoutSize.width;
itemRect.height = __layoutSize.height;
// _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);
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);