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

Side by Side Diff: ash/common/system/tray/tray_constants.cc

Issue 2147143002: [Chrome OS MD] Draw a 1px separator between 2 tray items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 5 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/common/system/tray/tray_constants.h" 5 #include "ash/common/system/tray/tray_constants.h"
6 6
7 #include "ash/common/material_design/material_design_controller.h" 7 #include "ash/common/material_design/material_design_controller.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "third_party/skia/include/core/SkColor.h" 9 #include "third_party/skia/include/core/SkColor.h"
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 kTrayPopupMinWidth - (kNotificationIconWidth + kNotificationButtonWidth + 77 kTrayPopupMinWidth - (kNotificationIconWidth + kNotificationButtonWidth +
78 (kTrayPopupPaddingHorizontal / 2) * 3); 78 (kTrayPopupPaddingHorizontal / 2) * 3);
79 79
80 const int kMessageCenterBubblePadding = 4; 80 const int kMessageCenterBubblePadding = 4;
81 81
82 const int kTrayIconSize = 16; 82 const int kTrayIconSize = 16;
83 const SkColor kTrayIconColor = SK_ColorWHITE; 83 const SkColor kTrayIconColor = SK_ColorWHITE;
84 const int kMenuIconSize = 20; 84 const int kMenuIconSize = 20;
85 const SkColor kMenuIconColor = SkColorSetRGB(0x5A, 0x5A, 0x5A); 85 const SkColor kMenuIconColor = SkColorSetRGB(0x5A, 0x5A, 0x5A);
86 86
87 const int kHitRegionPadding = 4;
88 const SkColor kSeparatorColor = SkColorSetA(SK_ColorWHITE, 0x29);
varkha 2016/07/14 21:34:48 Opacity seems quite low (16%?) so it is barely vis
yiyix 2016/07/26 20:27:31 The spec is changed to 0.24 instead. ref: https://
89 const int kSeparatorWidth = 1;
90
87 int GetTrayConstant(TrayConstant constant) { 91 int GetTrayConstant(TrayConstant constant) {
88 const int kTrayItemHeightLegacy[] = {38, 38, kTrayItemSize}; 92 const int kTrayItemHeightLegacy[] = {38, 38, kTrayItemSize};
89 const int kTraySpacing[] = {4, 4, 8}; 93 const int kTraySpacing[] = {4, 4, 0};
90 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 8}; 94 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 4};
91 const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize}; 95 const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize};
92 96
93 const int mode = MaterialDesignController::GetMode(); 97 const int mode = MaterialDesignController::GetMode();
94 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && 98 DCHECK(mode >= MaterialDesignController::NON_MATERIAL &&
95 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); 99 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL);
96 100
97 switch (constant) { 101 switch (constant) {
98 case TRAY_ITEM_HEIGHT_LEGACY: 102 case TRAY_ITEM_HEIGHT_LEGACY:
99 return kTrayItemHeightLegacy[mode]; 103 return kTrayItemHeightLegacy[mode];
100 case TRAY_SPACING: 104 case TRAY_SPACING:
101 return kTraySpacing[mode]; 105 return kTraySpacing[mode];
102 case TRAY_PADDING_FROM_EDGE_OF_SHELF: 106 case TRAY_PADDING_FROM_EDGE_OF_SHELF:
103 return kTrayPaddingFromEdgeOfShelf[mode]; 107 return kTrayPaddingFromEdgeOfShelf[mode];
104 case VIRTUAL_KEYBOARD_BUTTON_SIZE: 108 case VIRTUAL_KEYBOARD_BUTTON_SIZE:
105 return kVirtualKeyboardButtonSize[mode]; 109 return kVirtualKeyboardButtonSize[mode];
106 } 110 }
107 NOTREACHED(); 111 NOTREACHED();
108 return 0; 112 return 0;
109 } 113 }
110 114
111 } // namespace ash 115 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698