Commit 6c8b91bf authored by Yulun Wu's avatar Yulun Wu Committed by Commit Bot

Override app list folder view preferred bounds.

App list folders should expand from the folder's origin.The bounds for
the folder should be 8 dip from the edge of the screen and should not be
limited by the app list container bounds.


Bug: 1018305
Change-Id: I3597dbe96c697f5c268ddd9cc5157c62f7600f5e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2197422
Commit-Queue: Yulun Wu <yulunwu@chromium.org>
Reviewed-by: default avatarYulun Wu <yulunwu@chromium.org>
Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#768542}
parent 0da0700b
...@@ -48,6 +48,7 @@ namespace { ...@@ -48,6 +48,7 @@ namespace {
constexpr int kFolderHeaderPadding = 12; constexpr int kFolderHeaderPadding = 12;
constexpr int kOnscreenKeyboardTopPadding = 16; constexpr int kOnscreenKeyboardTopPadding = 16;
constexpr int kFolderHorizontalMargin = 8;
// Indexes of interesting views in ViewModel of AppListFolderView. // Indexes of interesting views in ViewModel of AppListFolderView.
constexpr int kIndexBackground = 0; constexpr int kIndexBackground = 0;
...@@ -605,11 +606,18 @@ void AppListFolderView::UpdatePreferredBounds() { ...@@ -605,11 +606,18 @@ void AppListFolderView::UpdatePreferredBounds() {
const gfx::Size search_box_size = const gfx::Size search_box_size =
contents_view_->GetSearchBoxSize(AppListState::kStateApps); contents_view_->GetSearchBoxSize(AppListState::kStateApps);
// Adjust for apps container margins. // Adjust for apps container margins.
container_bounds.Inset(container_view_->CalculateMarginsForAvailableBounds( gfx::Insets adjusted_margins =
container_bounds, search_box_size)); container_view_->CalculateMarginsForAvailableBounds(container_bounds,
search_box_size);
// App list folders can open past the app list bounds and within
// |kFolderHorizontalMargin| px of the screen.
adjusted_margins.set_left(kFolderHorizontalMargin);
adjusted_margins.set_right(kFolderHorizontalMargin);
container_bounds.Inset(adjusted_margins);
// Avoid overlap with the search box widget. // Avoid overlap with the search box widget.
container_bounds.Inset( container_bounds.Inset(
8, search_box_size.height() + SearchBoxView::GetFocusRingSpacing(), 8, 0); 0, search_box_size.height() + SearchBoxView::GetFocusRingSpacing(), 0, 0);
preferred_bounds_.AdjustToFit(container_bounds); preferred_bounds_.AdjustToFit(container_bounds);
// Calculate the folder icon's bounds relative to this view. // Calculate the folder icon's bounds relative to this view.
......
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