Commit ca28825e authored by harrym@chromium.org's avatar harrym@chromium.org

Partial revert of dynamic sizing of launcher buttons to maintain m26 behavior of launcher for m27.


BUG=222390


Review URL: https://chromiumcodereview.appspot.com/13982004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193338 0039d316-1c4b-4281-b951-d872f2087c98
parent 824d6f60
...@@ -392,17 +392,17 @@ void LauncherButton::GetAccessibleState(ui::AccessibleViewState* state) { ...@@ -392,17 +392,17 @@ void LauncherButton::GetAccessibleState(ui::AccessibleViewState* state) {
void LauncherButton::Layout() { void LauncherButton::Layout() {
const gfx::Rect button_bounds(GetContentsBounds()); const gfx::Rect button_bounds(GetContentsBounds());
int x_offset = 0, y_offset = 0;
int x_offset = shelf_layout_manager_->SelectValueForShelfAlignment( gfx::Rect icon_bounds;
0, kIconPad, kIconPad, 0); if (shelf_layout_manager_->IsHorizontalAlignment()) {
int y_offset = shelf_layout_manager_->SelectValueForShelfAlignment( icon_bounds.SetRect(
kIconPad, 0, 0, kIconPad); button_bounds.x(), button_bounds.y() + kIconPad,
button_bounds.width(), kIconSize);
int icon_width = std::min(kIconSize, button_bounds.width() - x_offset); } else {
int icon_height = std::min(kIconSize, button_bounds.height() - y_offset); icon_bounds.SetRect(
button_bounds.x() + kIconPad, button_bounds.y(),
x_offset = std::max(x_offset, (button_bounds.width() - icon_width) / 2); kIconSize, button_bounds.height());
y_offset = std::max(y_offset, (button_bounds.height() - icon_height) / 2); }
if (ShouldHop(state_)) { if (ShouldHop(state_)) {
x_offset += shelf_layout_manager_->SelectValueForShelfAlignment( x_offset += shelf_layout_manager_->SelectValueForShelfAlignment(
...@@ -411,11 +411,7 @@ void LauncherButton::Layout() { ...@@ -411,11 +411,7 @@ void LauncherButton::Layout() {
-kHopSpacing, 0, 0, kHopSpacing); -kHopSpacing, 0, 0, kHopSpacing);
} }
gfx::Rect icon_bounds( icon_bounds.Offset(x_offset, y_offset);
button_bounds.x() + x_offset,
button_bounds.y() + y_offset,
icon_width,
icon_height);
icon_view_->SetBoundsRect(icon_bounds); icon_view_->SetBoundsRect(icon_bounds);
bar_->SetBarBoundsRect(GetContentsBounds()); bar_->SetBarBoundsRect(GetContentsBounds());
UpdateState(); UpdateState();
......
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