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

Unified Diff: ash/common/system/tray/tray_utils.cc

Issue 2455183002: Simplify layout of tray items and fix spacing for MD. (Closed)
Patch Set: tda review Created 4 years, 2 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
« no previous file with comments | « ash/common/system/tray/tray_item_view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/tray_utils.cc
diff --git a/ash/common/system/tray/tray_utils.cc b/ash/common/system/tray/tray_utils.cc
index c427e654b3bdf2d90e360ccc1a0aca10461bb139..ee938941578564d7b048609da33dbac5c98338cd 100644
--- a/ash/common/system/tray/tray_utils.cc
+++ b/ash/common/system/tray/tray_utils.cc
@@ -37,10 +37,10 @@ void SetupLabelForTray(views::Label* label) {
}
}
-// TODO(yiyix): Instead of using a fixed padding beside each tray item, take
-// internal icon padding into account when adjusting tray icon spacing. See
-// crbug.com/653292.
void SetTrayImageItemBorder(views::View* tray_view, ShelfAlignment alignment) {
+ if (MaterialDesignController::IsShelfMaterial())
+ return;
+
const int tray_image_item_padding = GetTrayConstant(TRAY_IMAGE_ITEM_PADDING);
if (IsHorizontalAlignment(alignment)) {
tray_view->SetBorder(views::Border::CreateEmptyBorder(
@@ -55,6 +55,9 @@ void SetTrayImageItemBorder(views::View* tray_view, ShelfAlignment alignment) {
}
void SetTrayLabelItemBorder(TrayItemView* tray_view, ShelfAlignment alignment) {
+ if (MaterialDesignController::IsShelfMaterial())
+ return;
+
if (IsHorizontalAlignment(alignment)) {
tray_view->SetBorder(views::Border::CreateEmptyBorder(
0, kTrayLabelItemHorizontalPaddingBottomAlignment, 0,
« no previous file with comments | « ash/common/system/tray/tray_item_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698