Commit fb13532c authored by Weidong Guo's avatar Weidong Guo Committed by Commit Bot

Fix folder bounds issue

The fix in http://go/cgcl/1171905 causes the folder being clipped in
lower resolution. So we should still fit the folder inside
AppsContainerView, in the meanwhile, fit the folder under search box.

Bug: 875780
Change-Id: I147a10ebc1b10a770a23478d5fd22b084ce1d1dd
Reviewed-on: https://chromium-review.googlesource.com/1182620Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Weidong Guo <weidongg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584825}
parent 22fe0139
......@@ -581,11 +581,18 @@ void AppListFolderView::UpdatePreferredBounds() {
gfx::Rect icon_bounds_in_container = gfx::ToEnclosingRect(rect);
// The opened folder view's center should try to overlap with the folder
// item's center while it must fit within the bounds of AppsContainerView.
// item's center while it must fit within the bounds of AppsContainerView and
// below the search box.
preferred_bounds_ = gfx::Rect(GetPreferredSize());
preferred_bounds_ += (icon_bounds_in_container.CenterPoint() -
preferred_bounds_.CenterPoint());
preferred_bounds_.AdjustToFit(container_view_->apps_grid_view()->bounds());
gfx::Rect container_bounds = container_view_->GetContentsBounds();
container_bounds.Inset(
0,
AppListConfig::instance().search_box_fullscreen_top_padding() +
search_box::kSearchBoxPreferredHeight,
0, 0);
preferred_bounds_.AdjustToFit(container_bounds);
auto* const keyboard_controller = keyboard::KeyboardController::Get();
if (keyboard_controller->enabled()) {
......
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