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

Side by Side Diff: ash/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: address comments & Refactor border around item implementation 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/system/tray/tray_constants.h" 5 #include "ash/system/tray/tray_constants.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/material_design/material_design_controller.h"
9 #include "base/logging.h"
8 #include "third_party/skia/include/core/SkColor.h" 10 #include "third_party/skia/include/core/SkColor.h"
9 11
10 namespace ash { 12 namespace ash {
11 13
12 const int kPaddingFromRightEdgeOfScreenBottomAlignment = 7; 14 const int kPaddingFromRightEdgeOfScreenBottomAlignment = 7;
13 const int kPaddingFromBottomOfScreenBottomAlignment = 7; 15 const int kPaddingFromBottomOfScreenBottomAlignment = 7;
14 const int kPaddingFromOuterEdgeOfLauncherVerticalAlignment = 8; 16 const int kPaddingFromOuterEdgeOfLauncherVerticalAlignment = 8;
15 const int kPaddingFromInnerEdgeOfLauncherVerticalAlignment = 9; 17 const int kPaddingFromInnerEdgeOfLauncherVerticalAlignment = 9;
16 const int kPaddingFromBottomOfScreenVerticalAlignment = 10; 18 const int kPaddingFromBottomOfScreenVerticalAlignment = 10;
17 19
18 // Padding used to position the system menu relative to the status area. 20 // Padding used to position the system menu relative to the status area.
19 const int kBubblePaddingHorizontalBottom = 6; 21 const int kBubblePaddingHorizontalBottom = 6;
20 const int kBubblePaddingHorizontalSide = 10; 22 const int kBubblePaddingHorizontalSide = 10;
21 const int kBubblePaddingVerticalBottom = 3; 23 const int kBubblePaddingVerticalBottom = 3;
22 const int kBubblePaddingVerticalSide = 15; 24 const int kBubblePaddingVerticalSide = 15;
23 25
24 const int kPaddingFromEdgeOfShelf = 3; 26 // Padding used to adjust the size of status tray dark background.
27 const int kAdjustBackgroundPadding = 3;
25 28
26 // Top inset of system tray bubble for bottom anchor alignment. 29 // Top inset of system tray bubble for bottom anchor alignment.
27 const int kTrayBubbleAnchorTopInsetBottomAnchor = 3; 30 const int kTrayBubbleAnchorTopInsetBottomAnchor = 3;
28 31
29 const int kTrayImageItemHorizontalPaddingBottomAlignment = 1; 32 const int kTrayImageItemHorizontalPaddingBottomAlignment = 1;
30 const int kTrayImageItemHorizontalPaddingVerticalAlignment = 1; 33 const int kTrayImageItemHorizontalPaddingVerticalAlignment = 1;
31 const int kTrayImageItemVerticalPaddingVerticalAlignment = 1; 34 const int kTrayImageItemVerticalPaddingVerticalAlignment = 1;
32 35
33 // Size of tray items on the primary axis. 36 // Size of tray items on the primary axis.
34 const int kTrayItemSize = 32; 37 const int kTrayItemSize = 32;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 const int kTrayPopupMaxWidth = 500; 77 const int kTrayPopupMaxWidth = 500;
75 const int kNotificationIconWidth = 40; 78 const int kNotificationIconWidth = 40;
76 const int kNotificationButtonWidth = 32; 79 const int kNotificationButtonWidth = 32;
77 const int kTrayNotificationContentsWidth = kTrayPopupMinWidth - 80 const int kTrayNotificationContentsWidth = kTrayPopupMinWidth -
78 (kNotificationIconWidth + kNotificationButtonWidth + 81 (kNotificationIconWidth + kNotificationButtonWidth +
79 (kTrayPopupPaddingHorizontal / 2) * 3); 82 (kTrayPopupPaddingHorizontal / 2) * 3);
80 83
81 const int kTrayAvatarCornerRadius = 2; 84 const int kTrayAvatarCornerRadius = 2;
82 const int kTrayAvatarSize = 32; 85 const int kTrayAvatarSize = 32;
83 86
84 const int kTraySpacing = 4; 87 const int kMessageCenterBubblePadding = 4;
85 const int kShelfItemHeight = 38; 88 const int kShelfItemHeight = 38;
89 const int kOverviewButtonIndex = 0;
90
91 // static
tdanderson 2016/06/03 19:25:24 nit: remove this if the function isn't static
yiyix 2016/06/10 19:26:05 Sorry, I copied this over from another function
92 int GetTrayConstant(ShelfStatusAreaInset constant) {
93 const int kTraySpacing[] = {4, 2};
94 const int kPaddingFromEdgeOfShelf[] = {3, 5};
95
96 int mode = MaterialDesignController::IsShelfMaterial()
97 ? MaterialDesignController::Mode::MATERIAL_NORMAL
98 : MaterialDesignController::Mode::NON_MATERIAL;
99
100 switch (constant) {
101 case TRAY_SPACING:
102 return kTraySpacing[mode];
103 case PADDING_FROM_EDGE_OF_SHELF:
104 return kPaddingFromEdgeOfShelf[mode];
105 }
106 NOTREACHED();
107 return 0;
108 }
86 109
87 } // namespace ash 110 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698