Commit a5178107 authored by Yulun Wu's avatar Yulun Wu Committed by Commit Bot

CrOS: Add minimum spacing between SearchBox and Shelf.

Bug: 1007204
Change-Id: Ic6bea1eef809db4e995040d4bee82ea05aa57c7f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1838978Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Reviewed-by: default avatarToni Baržić <tbarzic@chromium.org>
Commit-Queue: Yulun Wu <yulunwu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#703499}
parent 19e54792
...@@ -58,6 +58,9 @@ constexpr int kSearchBoxHeight = 56; ...@@ -58,6 +58,9 @@ constexpr int kSearchBoxHeight = 56;
// due to the round up. // due to the round up.
constexpr int kSearchBoxBottomSpacing = 1; constexpr int kSearchBoxBottomSpacing = 1;
// Minimum spacing between shelf and bottom of search box.
constexpr int kSearchResultPageMinimumBottomMargin = 24;
constexpr SkColor kSeparatorColor = SkColorSetA(gfx::kGoogleGrey900, 0x24); constexpr SkColor kSeparatorColor = SkColorSetA(gfx::kGoogleGrey900, 0x24);
// The shadow elevation value for the shadow of the expanded search box. // The shadow elevation value for the shadow of the expanded search box.
...@@ -530,8 +533,16 @@ gfx::Rect SearchResultPageView::GetPageBoundsForState( ...@@ -530,8 +533,16 @@ gfx::Rect SearchResultPageView::GetPageBoundsForState(
// Hides this view behind the search box by using the same bounds. // Hides this view behind the search box by using the same bounds.
return search_box_bounds; return search_box_bounds;
} }
return gfx::Rect(search_box_bounds.origin(),
gfx::Size(search_box_bounds.width(), kHeight)); gfx::Rect bounding_rect = contents_bounds;
bounding_rect.Inset(0, 0, 0, kSearchResultPageMinimumBottomMargin);
gfx::Rect preferred_bounds =
gfx::Rect(search_box_bounds.origin(),
gfx::Size(search_box_bounds.width(), kHeight));
preferred_bounds.Intersect(bounding_rect);
return preferred_bounds;
} }
views::View* SearchResultPageView::GetFirstFocusableView() { views::View* SearchResultPageView::GetFirstFocusableView() {
......
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