Commit 8b139179 authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

views: use menu border inset to position submenus

Using the border inset directly, instead of trying to recompute it from the
MenuConfig, avoids positioning bugs when the submenu will have a border applied
to it.

Bug: 834934
Change-Id: Ic6c23f7dd5e34b643724c346bb89dac038dd58e4
Reviewed-on: https://chromium-review.googlesource.com/1231736Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#592377}
parent 46bad4b8
......@@ -2089,10 +2089,9 @@ gfx::Rect MenuController::CalculateMenuBounds(MenuItemView* item,
const int right_of_parent =
item_loc.x() + item->width() - submenu_horizontal_inset;
int border_size = menu_config.CornerRadiusForMenu(this);
if (!border_size)
border_size = menu_config.menu_vertical_border_size;
menu_bounds.set_y(item_loc.y() - border_size);
MenuScrollViewContainer* container =
item->GetParentMenuItem()->GetSubmenu()->GetScrollViewContainer();
menu_bounds.set_y(item_loc.y() - container->border()->GetInsets().top());
// Assume the menu can be placed in the preferred location.
menu_bounds.set_x(create_on_right ? right_of_parent : left_of_parent);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment