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

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: Created 4 years, 7 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 on empty border to Adjust the size of status tray dark
tdanderson 2016/05/26 22:55:56 nit: Adjust -> adjust
yiyix 2016/06/02 03:54:54 Done.
27 // background.
tdanderson 2016/05/26 22:55:56 Also, I am not a fan of how the comment is worded.
yiyix 2016/06/02 03:54:53 Done. I update the name as we have discussed in pe
28 const int kEmptyBoarderPadding = 3;
25 29
26 // Top inset of system tray bubble for bottom anchor alignment. 30 // Top inset of system tray bubble for bottom anchor alignment.
27 const int kTrayBubbleAnchorTopInsetBottomAnchor = 3; 31 const int kTrayBubbleAnchorTopInsetBottomAnchor = 3;
28 32
29 const int kTrayImageItemHorizontalPaddingBottomAlignment = 1; 33 const int kTrayImageItemHorizontalPaddingBottomAlignment = 1;
30 const int kTrayImageItemHorizontalPaddingVerticalAlignment = 1; 34 const int kTrayImageItemHorizontalPaddingVerticalAlignment = 1;
31 const int kTrayImageItemVerticalPaddingVerticalAlignment = 1; 35 const int kTrayImageItemVerticalPaddingVerticalAlignment = 1;
32 36
33 // Size of tray items on the primary axis. 37 // Size of tray items on the primary axis.
34 const int kTrayItemSize = 32; 38 const int kTrayItemSize = 32;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 const int kTrayPopupMaxWidth = 500; 78 const int kTrayPopupMaxWidth = 500;
75 const int kNotificationIconWidth = 40; 79 const int kNotificationIconWidth = 40;
76 const int kNotificationButtonWidth = 32; 80 const int kNotificationButtonWidth = 32;
77 const int kTrayNotificationContentsWidth = kTrayPopupMinWidth - 81 const int kTrayNotificationContentsWidth = kTrayPopupMinWidth -
78 (kNotificationIconWidth + kNotificationButtonWidth + 82 (kNotificationIconWidth + kNotificationButtonWidth +
79 (kTrayPopupPaddingHorizontal / 2) * 3); 83 (kTrayPopupPaddingHorizontal / 2) * 3);
80 84
81 const int kTrayAvatarCornerRadius = 2; 85 const int kTrayAvatarCornerRadius = 2;
82 const int kTrayAvatarSize = 32; 86 const int kTrayAvatarSize = 32;
83 87
84 const int kTraySpacing = 4; 88 const int kMessageCenterBubblePadding = 4;
85 const int kShelfItemHeight = 38; 89 const int kShelfItemHeight = 38;
86 90
91 // static
92 int GetShelfStatusAreaInset(ShelfStatusAreaInset constant) {
tdanderson 2016/05/26 22:55:56 I would just call this GetTrayConstant(). Similarl
yiyix 2016/06/02 03:54:54 Done.
93 const int kShelfStatusAreaInset[] = {0, 5};
94 const int kTraySpacing[] = {4, 2};
95 const int kPaddingFromEdgeOfShelf[] = {3, 0};
96
97 int mode = MaterialDesignController::Mode::NON_MATERIAL;
98 if (MaterialDesignController::IsShelfMaterial())
99 mode = MaterialDesignController::Mode::MATERIAL_NORMAL;
100
101 switch (constant) {
102 case ShelfStatusAreaInset::PADDING_FROM_EDGE_OF_SHELF:
103 return kShelfStatusAreaInset[mode];
104 case TRAY_SPACING:
105 return kTraySpacing[mode];
106 case PADDING_FROM_EDGE_TO_OVERVIEW_BUTTON:
tdanderson 2016/05/26 22:55:56 nit: be consistent with the naming of the constant
yiyix 2016/06/02 03:54:53 Done.
107 return kPaddingFromEdgeOfShelf[mode];
108 }
109 NOTREACHED();
110 return 0;
111 }
112
87 } // namespace ash 113 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698