Commit 2177f5fd authored by mgiuca's avatar mgiuca Committed by Commit bot

Experimental launcher: Switcher buttons are larger and centered.

Buttons are now 39x39, giving them bigger click/tap target zones,
spacing them further apart, and centering them within the switcher area.
The actual image sizes have not changed.

Moved the separator line up 1px to make room and to match the mocks.

Also added a new test of the exact dimensions of the app launcher, to
make sure we don't accidentally enlarge the window (which would have
been easy to accidentally do in this patch).

BUG=411775

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

Cr-Commit-Position: refs/heads/master@{#295934}
parent fb34b348
......@@ -89,7 +89,7 @@ void AppListBackground::Paint(gfx::Canvas* canvas,
gfx::Rect separator_rect(contents_rect);
separator_rect.Inset(
kExperimentalWindowPadding + main_view_->GetInsets().left(), 0);
separator_rect.set_y(contents_view_view_bounds.bottom());
separator_rect.set_y(contents_view_view_bounds.bottom() - 1);
separator_rect.set_height(kBottomSeparatorSize);
canvas->FillRect(separator_rect, kBottomSeparatorColor);
}
......
......@@ -239,11 +239,26 @@ void AppListViewTestContext::RunDisplayTest() {
Show();
// The landscape app launcher needs to be short enough to accomodate the
// virtual keyboard because it is enabled by default when the virtual keyboard
// is enabled.
if (test_type_ == LANDSCAPE)
EXPECT_GE(403, view_->bounds().height());
// Explicitly enforce the exact dimensions of the app list. Feel free to
// change these if you need to (they are just here to prevent against
// accidental changes to the window size).
switch (test_type_) {
case NORMAL:
EXPECT_EQ("400x500", view_->bounds().size().ToString());
break;
case LANDSCAPE:
// NOTE: Height should not exceed 402, because otherwise there might not
// be enough space to accomodate the virtual keyboard. (LANDSCAPE mode is
// enabled by default when the virtual keyboard is enabled.)
EXPECT_EQ("576x402", view_->bounds().size().ToString());
break;
case EXPERIMENTAL:
EXPECT_EQ("768x560", view_->bounds().size().ToString());
break;
default:
NOTREACHED();
break;
}
if (is_landscape())
EXPECT_EQ(2, GetPaginationModel()->total_pages());
......
......@@ -32,6 +32,9 @@ ContentsSwitcherView::~ContentsSwitcherView() {}
void ContentsSwitcherView::AddSwitcherButton(int resource_id, int page_index) {
views::ImageButton* button = new views::ImageButton(this);
button->SetMinimumImageSize(gfx::Size(kMinimumHeight, kMinimumHeight));
button->SetImageAlignment(views::ImageButton::ALIGN_CENTER,
views::ImageButton::ALIGN_MIDDLE);
button->SetImage(
views::CustomButton::STATE_NORMAL,
ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(resource_id));
......
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