Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2495)

Unified Diff: ash/common/system/overview/overview_button_tray.cc

Issue 2147143002: [Chrome OS MD] Draw a 1px separator between 2 tray items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address nits Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/common/system/overview/overview_button_tray.cc
diff --git a/ash/common/system/overview/overview_button_tray.cc b/ash/common/system/overview/overview_button_tray.cc
index e3508b474c4a26553b89336f0d3ed517b8783ff8..d47d578004a774711936b40827906cce37352fdb 100644
--- a/ash/common/system/overview/overview_button_tray.cc
+++ b/ash/common/system/overview/overview_button_tray.cc
@@ -114,24 +114,21 @@ void OverviewButtonTray::SetShelfAlignment(ShelfAlignment alignment) {
}
void OverviewButtonTray::SetIconBorderForShelfAlignment() {
+ gfx::Insets insets;
if (ash::MaterialDesignController::IsShelfMaterial()) {
// Pad button size to align with other controls in the system tray.
const gfx::ImageSkia image = icon_->GetImage();
const int vertical_padding = (kTrayItemSize - image.height()) / 2;
const int horizontal_padding = (kTrayItemSize - image.width()) / 2;
- icon_->SetBorder(views::Border::CreateEmptyBorder(
- gfx::Insets(vertical_padding, horizontal_padding)));
+ insets = gfx::Insets(vertical_padding, horizontal_padding);
} else {
- if (IsHorizontalAlignment(shelf_alignment())) {
- icon_->SetBorder(views::Border::CreateEmptyBorder(
- kHorizontalShelfVerticalPadding, kHorizontalShelfHorizontalPadding,
- kHorizontalShelfVerticalPadding, kHorizontalShelfHorizontalPadding));
- } else {
- icon_->SetBorder(views::Border::CreateEmptyBorder(
- kVerticalShelfVerticalPadding, kVerticalShelfHorizontalPadding,
- kVerticalShelfVerticalPadding, kVerticalShelfHorizontalPadding));
- }
+ insets = IsHorizontalAlignment(shelf_alignment())
+ ? gfx::Insets(kHorizontalShelfVerticalPadding,
+ kHorizontalShelfHorizontalPadding)
+ : gfx::Insets(kVerticalShelfVerticalPadding,
+ kVerticalShelfHorizontalPadding);
}
+ icon_->SetBorder(views::Border::CreateEmptyBorder(insets));
}
void OverviewButtonTray::UpdateIconVisibility() {
« no previous file with comments | « ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc ('k') | ash/common/system/status_area_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698