| OLD | NEW |
| 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" |
| 8 #include "base/logging.h" |
| 7 #include "third_party/skia/include/core/SkColor.h" | 9 #include "third_party/skia/include/core/SkColor.h" |
| 8 | 10 |
| 9 namespace ash { | 11 namespace ash { |
| 10 | 12 |
| 11 const int kPaddingFromRightEdgeOfScreenBottomAlignment = 7; | 13 const int kPaddingFromRightEdgeOfScreenBottomAlignment = 7; |
| 12 const int kPaddingFromBottomOfScreenBottomAlignment = 7; | 14 const int kPaddingFromBottomOfScreenBottomAlignment = 7; |
| 13 const int kPaddingFromOuterEdgeOfLauncherVerticalAlignment = 8; | 15 const int kPaddingFromOuterEdgeOfLauncherVerticalAlignment = 8; |
| 14 const int kPaddingFromInnerEdgeOfLauncherVerticalAlignment = 9; | 16 const int kPaddingFromInnerEdgeOfLauncherVerticalAlignment = 9; |
| 15 const int kPaddingFromBottomOfScreenVerticalAlignment = 10; | 17 const int kPaddingFromBottomOfScreenVerticalAlignment = 10; |
| 16 | 18 |
| 17 // Padding used to position the system menu relative to the status area. | 19 // Padding used to position the system menu relative to the status area. |
| 18 const int kBubblePaddingHorizontalBottom = 6; | 20 const int kBubblePaddingHorizontalBottom = 6; |
| 19 const int kBubblePaddingHorizontalSide = 10; | 21 const int kBubblePaddingHorizontalSide = 10; |
| 20 const int kBubblePaddingVerticalBottom = 3; | 22 const int kBubblePaddingVerticalBottom = 3; |
| 21 const int kBubblePaddingVerticalSide = 15; | 23 const int kBubblePaddingVerticalSide = 15; |
| 22 | 24 |
| 23 const int kPaddingFromEdgeOfShelf = 3; | 25 // Padding used to adjust the size of status tray dark background. |
| 26 const int kAdjustBackgroundPadding = 3; |
| 24 | 27 |
| 25 // Top inset of system tray bubble for bottom anchor alignment. | 28 // Top inset of system tray bubble for bottom anchor alignment. |
| 26 const int kTrayBubbleAnchorTopInsetBottomAnchor = 3; | 29 const int kTrayBubbleAnchorTopInsetBottomAnchor = 3; |
| 27 | 30 |
| 28 const int kTrayImageItemHorizontalPaddingBottomAlignment = 1; | 31 const int kTrayImageItemHorizontalPaddingBottomAlignment = 1; |
| 29 const int kTrayImageItemHorizontalPaddingVerticalAlignment = 1; | 32 const int kTrayImageItemHorizontalPaddingVerticalAlignment = 1; |
| 30 const int kTrayImageItemVerticalPaddingVerticalAlignment = 1; | 33 const int kTrayImageItemVerticalPaddingVerticalAlignment = 1; |
| 31 | 34 |
| 32 // Size of tray items on the primary axis. | 35 // Size of tray items on the primary axis. |
| 33 const int kTrayItemSize = 32; | 36 const int kTrayItemSize = 32; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 const int kTrayPopupMaxWidth = 500; | 76 const int kTrayPopupMaxWidth = 500; |
| 74 const int kNotificationIconWidth = 40; | 77 const int kNotificationIconWidth = 40; |
| 75 const int kNotificationButtonWidth = 32; | 78 const int kNotificationButtonWidth = 32; |
| 76 const int kTrayNotificationContentsWidth = kTrayPopupMinWidth - | 79 const int kTrayNotificationContentsWidth = kTrayPopupMinWidth - |
| 77 (kNotificationIconWidth + kNotificationButtonWidth + | 80 (kNotificationIconWidth + kNotificationButtonWidth + |
| 78 (kTrayPopupPaddingHorizontal / 2) * 3); | 81 (kTrayPopupPaddingHorizontal / 2) * 3); |
| 79 | 82 |
| 80 const int kTrayAvatarCornerRadius = 2; | 83 const int kTrayAvatarCornerRadius = 2; |
| 81 const int kTrayAvatarSize = 32; | 84 const int kTrayAvatarSize = 32; |
| 82 | 85 |
| 83 const int kTraySpacing = 4; | 86 const int kMessageCenterBubblePadding = 4; |
| 84 const int kShelfItemHeight = 38; | 87 const int kShelfItemHeight = 38; |
| 85 | 88 |
| 89 // Items are 32 by 32 in the new Chrome OS MD requirements. |
| 90 const int kShelfItemSizeMD = 32; |
| 91 |
| 92 int GetTrayConstant(TrayConstant constant) { |
| 93 const int kTraySpacing[] = {4, 8, 8}; |
| 94 const int kTrayPaddingFromEdgeOfShelf[] = {3, 8, 8}; |
| 95 |
| 96 const int mode = MaterialDesignController::GetMode(); |
| 97 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && |
| 98 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); |
| 99 |
| 100 switch (constant) { |
| 101 case TRAY_SPACING: |
| 102 return kTraySpacing[mode]; |
| 103 case TRAY_PADDING_FROM_EDGE_OF_SHELF: |
| 104 return kTrayPaddingFromEdgeOfShelf[mode]; |
| 105 } |
| 106 NOTREACHED(); |
| 107 return 0; |
| 108 } |
| 109 |
| 86 } // namespace ash | 110 } // namespace ash |
| OLD | NEW |