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

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: address nits Created 4 years, 4 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
« no previous file with comments | « ash/common/system/tray/tray_constants.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 kTrayPopupMinWidth - (kNotificationIconWidth + kNotificationButtonWidth + 81 kTrayPopupMinWidth - (kNotificationIconWidth + kNotificationButtonWidth +
82 (kTrayPopupPaddingHorizontal / 2) * 3); 82 (kTrayPopupPaddingHorizontal / 2) * 3);
83 83
84 const int kMessageCenterBubblePadding = 4; 84 const int kMessageCenterBubblePadding = 4;
85 85
86 const int kTrayIconSize = 16; 86 const int kTrayIconSize = 16;
87 const SkColor kTrayIconColor = SK_ColorWHITE; 87 const SkColor kTrayIconColor = SK_ColorWHITE;
88 const int kMenuIconSize = 20; 88 const int kMenuIconSize = 20;
89 const SkColor kMenuIconColor = SkColorSetRGB(0x5A, 0x5A, 0x5A); 89 const SkColor kMenuIconColor = SkColorSetRGB(0x5A, 0x5A, 0x5A);
90 90
91 const int kHitRegionPadding = 4;
92 const SkColor kSeparatorColor = SkColorSetA(SK_ColorWHITE, 0x3D);
93 const int kSeparatorWidth = 1;
94
91 int GetTrayConstant(TrayConstant constant) { 95 int GetTrayConstant(TrayConstant constant) {
92 const int kTrayItemHeightLegacy[] = {38, 38, kTrayItemSize}; 96 const int kTrayItemHeightLegacy[] = {38, 38, kTrayItemSize};
93 const int kTraySpacing[] = {4, 4, 8}; 97 const int kTraySpacing[] = {4, 4, 0};
94 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 8}; 98 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 4};
95 const int kTrayPopupItemHeight[] = {46, 46, 48}; 99 const int kTrayPopupItemHeight[] = {46, 46, 48};
96 const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize}; 100 const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize};
97 101
98 const int mode = MaterialDesignController::GetMode(); 102 const int mode = MaterialDesignController::GetMode();
99 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && 103 DCHECK(mode >= MaterialDesignController::NON_MATERIAL &&
100 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); 104 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL);
101 105
102 switch (constant) { 106 switch (constant) {
103 case TRAY_ITEM_HEIGHT_LEGACY: 107 case TRAY_ITEM_HEIGHT_LEGACY:
104 return kTrayItemHeightLegacy[mode]; 108 return kTrayItemHeightLegacy[mode];
105 case TRAY_SPACING: 109 case TRAY_SPACING:
106 return kTraySpacing[mode]; 110 return kTraySpacing[mode];
107 case TRAY_PADDING_FROM_EDGE_OF_SHELF: 111 case TRAY_PADDING_FROM_EDGE_OF_SHELF:
108 return kTrayPaddingFromEdgeOfShelf[mode]; 112 return kTrayPaddingFromEdgeOfShelf[mode];
109 case TRAY_POPUP_ITEM_HEIGHT: 113 case TRAY_POPUP_ITEM_HEIGHT:
110 return kTrayPopupItemHeight[mode]; 114 return kTrayPopupItemHeight[mode];
111 case VIRTUAL_KEYBOARD_BUTTON_SIZE: 115 case VIRTUAL_KEYBOARD_BUTTON_SIZE:
112 return kVirtualKeyboardButtonSize[mode]; 116 return kVirtualKeyboardButtonSize[mode];
113 } 117 }
114 NOTREACHED(); 118 NOTREACHED();
115 return 0; 119 return 0;
116 } 120 }
117 121
118 } // namespace ash 122 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/system/tray/tray_constants.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698