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

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

Issue 2099103002: Give Ash material design tray items the correct size and layout (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: split shelf and tray constants Created 4 years, 6 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/tray/tray_constants.cc
diff --git a/ash/common/system/tray/tray_constants.cc b/ash/common/system/tray/tray_constants.cc
index 0ab90a1e36140670ae0f7290c8f92ea07b2d765c..ade8da6d539eb16baa9cebe39ba698b18f70393c 100644
--- a/ash/common/system/tray/tray_constants.cc
+++ b/ash/common/system/tray/tray_constants.cc
@@ -22,9 +22,6 @@ const int kBubblePaddingHorizontalSide = 10;
const int kBubblePaddingVerticalBottom = 3;
const int kBubblePaddingVerticalSide = 15;
-// Padding used to adjust the size of status tray dark background.
-const int kAdjustBackgroundPadding = 3;
-
// Top inset of system tray bubble for bottom anchor alignment.
const int kTrayBubbleAnchorTopInsetBottomAnchor = 3;
@@ -50,12 +47,12 @@ const int kTrayPopupPaddingBetweenItems = 10;
const int kTrayPopupTextSpacingVertical = 4;
const int kTrayPopupUserCardVerticalPadding = 10;
+const int kTrayPopupItemHeight = 46;
const int kTrayPopupDetailsIconWidth = 25;
const int kTrayPopupDetailsLabelExtraLeftMargin = 8;
const SkColor kTrayPopupHoverBackgroundColor = SkColorSetRGB(0xe4, 0xe4, 0xe4);
const int kTrayPopupScrollSeparatorHeight = 15;
const int kTrayRoundedBorderRadius = 2;
-const int kTrayBarButtonWidth = 39;
const SkColor kBackgroundColor = SkColorSetRGB(0xfe, 0xfe, 0xfe);
const SkColor kHoverBackgroundColor = SkColorSetRGB(0xf3, 0xf3, 0xf3);
@@ -80,28 +77,27 @@ const int kTrayNotificationContentsWidth =
kTrayPopupMinWidth - (kNotificationIconWidth + kNotificationButtonWidth +
(kTrayPopupPaddingHorizontal / 2) * 3);
-const int kTrayAvatarCornerRadius = 2;
-const int kTrayAvatarSize = 32;
-
const int kMessageCenterBubblePadding = 4;
-const int kShelfItemHeight = 38;
-
-// Items are 32 by 32 in the new Chrome OS MD requirements.
-const int kShelfItemSizeMD = 32;
int GetTrayConstant(TrayConstant constant) {
+ const int kTrayItemHeightLegacy[] = {38, 38, kTrayItemSize};
const int kTraySpacing[] = {4, 4, 8};
const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 8};
+ const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize};
const int mode = MaterialDesignController::GetMode();
DCHECK(mode >= MaterialDesignController::NON_MATERIAL &&
mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL);
switch (constant) {
+ case TRAY_ITEM_HEIGHT_LEGACY:
+ return kTrayItemHeightLegacy[mode];
case TRAY_SPACING:
return kTraySpacing[mode];
case TRAY_PADDING_FROM_EDGE_OF_SHELF:
return kTrayPaddingFromEdgeOfShelf[mode];
+ case VIRTUAL_KEYBOARD_BUTTON_SIZE:
+ return kVirtualKeyboardButtonSize[mode];
}
NOTREACHED();
return 0;
« no previous file with comments | « ash/common/system/tray/tray_constants.h ('k') | ash/common/system/web_notification/web_notification_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698