Commit 9e3593a8 authored by Jenny Zhang's avatar Jenny Zhang Committed by Commit Bot

Fix the issue of separator line being chopped by search box bottom.

Bug: 995962
Change-Id: I7944ae293fb146e3d9314a8b029fcab6ba2809de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1778595Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Jenny Zhang <jennyz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#692224}
parent fe777d62
...@@ -51,6 +51,12 @@ constexpr int kSeparatorThickness = 1; ...@@ -51,6 +51,12 @@ constexpr int kSeparatorThickness = 1;
// The height of the search box in this page. // The height of the search box in this page.
constexpr int kSearchBoxHeight = 56; constexpr int kSearchBoxHeight = 56;
// The spacing between search box bottom and separator line.
// Add 1 pixel spacing so that the search bbox bottom will not paint over
// the separator line drawn by SearchResultPageBackground in some scale factors
// due to the round up.
constexpr int kSearchBoxBottomSpacing = 1;
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.
...@@ -103,7 +109,7 @@ class SearchResultPageBackground : public views::Background { ...@@ -103,7 +109,7 @@ class SearchResultPageBackground : public views::Background {
if (bounds.height() <= kSearchBoxHeight) if (bounds.height() <= kSearchBoxHeight)
return; return;
// Draw a separator between SearchBoxView and SearchResultPageView. // Draw a separator between SearchBoxView and SearchResultPageView.
bounds.set_y(kSearchBoxHeight); bounds.set_y(kSearchBoxHeight + kSearchBoxBottomSpacing);
bounds.set_height(kSeparatorThickness); bounds.set_height(kSeparatorThickness);
canvas->FillRect(bounds, kSeparatorColor); canvas->FillRect(bounds, kSeparatorColor);
} }
...@@ -166,8 +172,9 @@ SearchResultPageView::SearchResultPageView(AppListViewDelegate* view_delegate) ...@@ -166,8 +172,9 @@ SearchResultPageView::SearchResultPageView(AppListViewDelegate* view_delegate)
AppListConfig::instance().card_background_color())); AppListConfig::instance().card_background_color()));
views::ScrollView* const scroller = new views::ScrollView; views::ScrollView* const scroller = new views::ScrollView;
// Leaves a placeholder area for the search box and the separator below it. // Leaves a placeholder area for the search box and the separator below it.
scroller->SetBorder(views::CreateEmptyBorder( scroller->SetBorder(views::CreateEmptyBorder(gfx::Insets(
gfx::Insets(kSearchBoxHeight + kSeparatorThickness, 0, 0, 0))); kSearchBoxHeight + kSearchBoxBottomSpacing + kSeparatorThickness, 0, 0,
0)));
scroller->SetDrawOverflowIndicator(false); scroller->SetDrawOverflowIndicator(false);
scroller->SetContents(base::WrapUnique(contents_view_)); scroller->SetContents(base::WrapUnique(contents_view_));
// Setting clip height is necessary to make ScrollView take into account its // Setting clip height is necessary to make ScrollView take into account its
......
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