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

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

Issue 1998933002: Update shelf spacing in Chrome OS according to the MD specs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge 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
« no previous file with comments | « ash/common/system/tray/tray_constants.h ('k') | ash/root_window_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 90c6aa9df50fd9dedda9fc785145501fee177bd5..4c719ad77e21cb8e069205be96a510a706856ded 100644
--- a/ash/common/system/tray/tray_constants.cc
+++ b/ash/common/system/tray/tray_constants.cc
@@ -4,6 +4,8 @@
#include "ash/common/system/tray/tray_constants.h"
+#include "ash/common/material_design/material_design_controller.h"
+#include "base/logging.h"
#include "third_party/skia/include/core/SkColor.h"
namespace ash {
@@ -20,7 +22,8 @@ const int kBubblePaddingHorizontalSide = 10;
const int kBubblePaddingVerticalBottom = 3;
const int kBubblePaddingVerticalSide = 15;
-const int kPaddingFromEdgeOfShelf = 3;
+// 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;
@@ -80,7 +83,28 @@ const int kTrayNotificationContentsWidth = kTrayPopupMinWidth -
const int kTrayAvatarCornerRadius = 2;
const int kTrayAvatarSize = 32;
-const int kTraySpacing = 4;
+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 kTraySpacing[] = {4, 8, 8};
+ const int kTrayPaddingFromEdgeOfShelf[] = {3, 8, 8};
+
+ const int mode = MaterialDesignController::GetMode();
+ DCHECK(mode >= MaterialDesignController::NON_MATERIAL &&
+ mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL);
+
+ switch (constant) {
+ case TRAY_SPACING:
+ return kTraySpacing[mode];
+ case TRAY_PADDING_FROM_EDGE_OF_SHELF:
+ return kTrayPaddingFromEdgeOfShelf[mode];
+ }
+ NOTREACHED();
+ return 0;
+}
+
} // namespace ash
« no previous file with comments | « ash/common/system/tray/tray_constants.h ('k') | ash/root_window_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698