Commit 3661ba43 authored by Manu Cornet's avatar Manu Cornet Committed by Commit Bot

Fix a bug with shelf icon centering

This fixes an issue where the app list button position wasn't properly
calculated, causing the shelf icons to sometimes "bleed" over the app
list button.

Bug: 805612
Bug: 869649
Change-Id: Id774e15edbde8704789ed77bb36da194060fc3e9
Reviewed-on: https://chromium-review.googlesource.com/1173753Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Manu Cornet <manucornet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583026}
parent 25756bb5
...@@ -989,8 +989,6 @@ void ShelfView::CalculateIdealBounds(gfx::Rect* overflow_bounds) const { ...@@ -989,8 +989,6 @@ void ShelfView::CalculateIdealBounds(gfx::Rect* overflow_bounds) const {
// opacity 0 anyways. // opacity 0 anyways.
if (i == kBackButtonIndex && !IsTabletModeEnabled()) if (i == kBackButtonIndex && !IsTabletModeEnabled())
continue; continue;
if (i == kAppListButtonIndex)
app_list_button_position = shelf_->PrimaryAxisValue(x, y);
// There is no spacing between the first two elements. Do not worry about y // There is no spacing between the first two elements. Do not worry about y
// since the back button only appears in tablet mode, which forces the shelf // since the back button only appears in tablet mode, which forces the shelf
...@@ -998,6 +996,9 @@ void ShelfView::CalculateIdealBounds(gfx::Rect* overflow_bounds) const { ...@@ -998,6 +996,9 @@ void ShelfView::CalculateIdealBounds(gfx::Rect* overflow_bounds) const {
x = shelf_->PrimaryAxisValue(x + w + (i == 0 ? 0 : button_spacing), x); x = shelf_->PrimaryAxisValue(x + w + (i == 0 ? 0 : button_spacing), x);
y = shelf_->PrimaryAxisValue(y, y + h + button_spacing); y = shelf_->PrimaryAxisValue(y, y + h + button_spacing);
if (i == kAppListButtonIndex)
app_list_button_position = shelf_->PrimaryAxisValue(x, y);
if (i == separator_index) { if (i == separator_index) {
// Place the separator halfway between the two icons it separates, // Place the separator halfway between the two icons it separates,
// vertically centered. // vertically centered.
......
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