Index: ash/system/overview/overview_button_tray.cc |
diff --git a/ash/system/overview/overview_button_tray.cc b/ash/system/overview/overview_button_tray.cc |
index bca2dd7aede73b18c2f6e8109b9cf925bf97ccc0..6040e38bab5d0c03db6f705750b21e5b63d91aca 100644 |
--- a/ash/system/overview/overview_button_tray.cc |
+++ b/ash/system/overview/overview_button_tray.cc |
@@ -10,6 +10,7 @@ |
#include "ash/common/shelf/shelf_types.h" |
#include "ash/common/shelf/wm_shelf_util.h" |
#include "ash/common/system/tray/system_tray_delegate.h" |
+#include "ash/common/system/tray/tray_constants.h" |
#include "ash/common/system/tray/tray_utils.h" |
#include "ash/common/wm/overview/window_selector_controller.h" |
#include "ash/common/wm_shell.h" |
@@ -116,14 +117,26 @@ void OverviewButtonTray::SetShelfAlignment(ShelfAlignment alignment) { |
} |
void OverviewButtonTray::SetIconBorderForShelfAlignment() { |
- if (IsHorizontalAlignment(shelf_alignment())) { |
+ if (ash::MaterialDesignController::IsShelfMaterial()) { |
+ // Pad button size to align with other controls in the system tray. |
+ const gfx::ImageSkia image = icon_->GetImage(); |
+ const int top_padding = (kTrayItemSize - image.height()) / 2; |
+ const int left_padding = (kTrayItemSize - image.width()) / 2; |
+ const int bottom_padding = kTrayItemSize - image.height() - top_padding; |
+ const int right_padding = kTrayItemSize - image.width() - left_padding; |
+ |
icon_->SetBorder(views::Border::CreateEmptyBorder( |
- kHorizontalShelfVerticalPadding, kHorizontalShelfHorizontalPadding, |
- kHorizontalShelfVerticalPadding, kHorizontalShelfHorizontalPadding)); |
+ top_padding, left_padding, bottom_padding, right_padding)); |
} else { |
- icon_->SetBorder(views::Border::CreateEmptyBorder( |
- kVerticalShelfVerticalPadding, kVerticalShelfHorizontalPadding, |
- kVerticalShelfVerticalPadding, kVerticalShelfHorizontalPadding)); |
+ if (IsHorizontalAlignment(shelf_alignment())) { |
+ icon_->SetBorder(views::Border::CreateEmptyBorder( |
+ kHorizontalShelfVerticalPadding, kHorizontalShelfHorizontalPadding, |
+ kHorizontalShelfVerticalPadding, kHorizontalShelfHorizontalPadding)); |
+ } else { |
+ icon_->SetBorder(views::Border::CreateEmptyBorder( |
+ kVerticalShelfVerticalPadding, kVerticalShelfHorizontalPadding, |
+ kVerticalShelfVerticalPadding, kVerticalShelfHorizontalPadding)); |
+ } |
} |
} |