Commit d2c3a964 authored by calamity's avatar calamity Committed by Commit bot

Adjust experimental app list padding.

This CL changes the padding values in the experimental app list to
precisely match the padding spec.

BUG=411775

Review URL: https://codereview.chromium.org/570233002

Cr-Commit-Position: refs/heads/master@{#295252}
parent d9168de8
......@@ -87,10 +87,7 @@ void AppListBackground::Paint(gfx::Canvas* canvas,
const gfx::Rect contents_view_view_bounds =
contents_view->ConvertRectToWidget(contents_view->GetLocalBounds());
gfx::Rect separator_rect(contents_rect);
// Extra kContentsSwitcherSeparatorHeight pixels so the launcher page
// indicator overlays the separator rect.
separator_rect.set_y(contents_view_view_bounds.bottom() +
kContentsSwitcherSeparatorHeight);
separator_rect.set_y(contents_view_view_bounds.bottom());
separator_rect.set_height(kBottomSeparatorSize);
canvas->FillRect(separator_rect, kBottomSeparatorColor);
int contents_switcher_top = separator_rect.bottom();
......
......@@ -36,15 +36,14 @@ namespace app_list {
namespace {
// Inner padding space in pixels of bubble contents.
const int kInnerPadding = 1;
// Border padding space around the bubble contents.
const int kPadding = 1;
// The maximum allowed time to wait for icon loading in milliseconds.
const int kMaxIconLoadingWaitTimeInMs = 50;
// The padding around the search box in the experimental app list.
const int kSearchBoxViewPadding = 24;
const int kSearchBoxViewPaddingBottom = 12;
const int kSearchBoxViewPadding = 23;
// A view that holds another view and takes its preferred size. This is used for
// wrapping the search box view so it still gets laid out while hidden. This is
......@@ -119,10 +118,8 @@ AppListMainView::AppListMainView(AppListViewDelegate* delegate,
contents_view_(NULL),
contents_switcher_view_(NULL),
weak_ptr_factory_(this) {
SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical,
kInnerPadding,
kInnerPadding,
kInnerPadding));
SetLayoutManager(
new views::BoxLayout(views::BoxLayout::kVertical, kPadding, kPadding, 0));
search_box_view_ = new SearchBoxView(this, delegate);
views::View* container = new SearchBoxContainerView(this, search_box_view_);
......@@ -130,7 +127,7 @@ AppListMainView::AppListMainView(AppListViewDelegate* delegate,
container->SetBorder(
views::Border::CreateEmptyBorder(kSearchBoxViewPadding,
kSearchBoxViewPadding,
kSearchBoxViewPaddingBottom,
0,
kSearchBoxViewPadding));
}
AddChildView(container);
......
......@@ -60,9 +60,8 @@ namespace {
const int kDragBufferPx = 20;
// Padding space in pixels for fixed layout.
const int kLeftRightPadding = 20;
const int kLeftRightPadding = 23;
const int kTopPadding = 1;
const int kBottomPadding = 24;
// Padding space in pixels between pages.
const int kPagePadding = 40;
......@@ -426,7 +425,10 @@ void AppsGridView::SetLayout(int cols, int rows_per_page) {
rows_per_page_ = rows_per_page;
SetBorder(views::Border::CreateEmptyBorder(
kTopPadding, kLeftRightPadding, 0, kLeftRightPadding));
switches::IsExperimentalAppListEnabled() ? 0 : kTopPadding,
kLeftRightPadding,
0,
kLeftRightPadding));
}
void AppsGridView::ResetForShowApps() {
......@@ -894,7 +896,7 @@ bool AppsGridView::IsAnimatingView(views::View* view) {
gfx::Size AppsGridView::GetPreferredSize() const {
const gfx::Insets insets(GetInsets());
int page_switcher_height = kBottomPadding;
int page_switcher_height = 0;
if (page_switcher_view_)
page_switcher_height = page_switcher_view_->GetPreferredSize().height();
gfx::Size size = GetTileGridSize();
......
......@@ -18,6 +18,7 @@ namespace {
const int kButtonImageSize = 32;
const int kButtonSpacing = 4;
const int kMinimumHeight = 39;
class ContentsPageIndicatorView : public views::View {
public:
......@@ -40,6 +41,7 @@ ContentsSwitcherView::ContentsSwitcherView(ContentsView* contents_view)
views::BoxLayout* layout = new views::BoxLayout(
views::BoxLayout::kHorizontal, 0, 0, kButtonSpacing);
layout->set_main_axis_alignment(views::BoxLayout::MAIN_AXIS_ALIGNMENT_CENTER);
layout->set_minimum_cross_axis_size(kMinimumHeight);
SetLayoutManager(layout);
}
......
......@@ -38,9 +38,6 @@ const SkColor kHintTextColor = SkColorSetRGB(0xA0, 0xA0, 0xA0);
const int kMenuYOffsetFromButton = -4;
const int kMenuXOffsetFromButton = -7;
// Experimental app list constants.
const int kExperimentalSearchBoxHeight = 37;
const int kBackgroundBorderWidth = 1;
const int kBackgroundBorderBottomWidth = 1;
const int kBackgroundBorderCornerRadius = 2;
......@@ -102,9 +99,7 @@ SearchBoxView::SearchBoxView(SearchBoxViewDelegate* delegate,
SetLayoutManager(layout);
layout->set_cross_axis_alignment(
views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER);
layout->set_minimum_cross_axis_size(switches::IsExperimentalAppListEnabled()
? kExperimentalSearchBoxHeight
: kPreferredHeight);
layout->set_minimum_cross_axis_size(kPreferredHeight);
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
......@@ -166,10 +161,7 @@ void SearchBoxView::InvalidateMenu() {
}
gfx::Size SearchBoxView::GetPreferredSize() const {
return gfx::Size(kPreferredWidth,
switches::IsExperimentalAppListEnabled()
? kExperimentalSearchBoxHeight
: kPreferredHeight);
return gfx::Size(kPreferredWidth, kPreferredHeight);
}
bool SearchBoxView::OnMouseWheel(const ui::MouseWheelEvent& event) {
......
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