| 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" | 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 11 matching lines...) Expand all Loading... |
| 22 const int kBubblePaddingVerticalBottom = 3; | 22 const int kBubblePaddingVerticalBottom = 3; |
| 23 const int kBubblePaddingVerticalSide = 15; | 23 const int kBubblePaddingVerticalSide = 15; |
| 24 | 24 |
| 25 // Top inset of system tray bubble for bottom anchor alignment. | 25 // Top inset of system tray bubble for bottom anchor alignment. |
| 26 const int kTrayBubbleAnchorTopInsetBottomAnchor = 3; | 26 const int kTrayBubbleAnchorTopInsetBottomAnchor = 3; |
| 27 | 27 |
| 28 const int kTrayImageItemHorizontalPaddingBottomAlignment = 1; | 28 const int kTrayImageItemHorizontalPaddingBottomAlignment = 1; |
| 29 const int kTrayImageItemHorizontalPaddingVerticalAlignment = 1; | 29 const int kTrayImageItemHorizontalPaddingVerticalAlignment = 1; |
| 30 const int kTrayImageItemVerticalPaddingVerticalAlignment = 1; | 30 const int kTrayImageItemVerticalPaddingVerticalAlignment = 1; |
| 31 | 31 |
| 32 // Size of IME menu tray. | |
| 33 const int kTrayImeIconSize = 40; | |
| 34 const int kTrayImeBottomRowPadding = 5; | |
| 35 const int kTrayImeBottomRowPaddingBetweenItems = 2; | |
| 36 | |
| 37 // Size of tray items on the primary axis. | 32 // Size of tray items on the primary axis. |
| 38 const int kTrayItemSize = 32; | 33 const int kTrayItemSize = 32; |
| 39 | 34 |
| 40 const int kTrayLabelItemHorizontalPaddingBottomAlignment = 7; | 35 const int kTrayLabelItemHorizontalPaddingBottomAlignment = 7; |
| 41 | 36 |
| 42 // Vertical padding between status tray items when the shelf is vertical. | 37 // Vertical padding between status tray items when the shelf is vertical. |
| 43 const int kTrayLabelItemVerticalPaddingVerticalAlignment = 4; | 38 const int kTrayLabelItemVerticalPaddingVerticalAlignment = 4; |
| 44 | 39 |
| 45 const int kTrayMenuBottomRowPadding = 5; | 40 const int kTrayMenuBottomRowPadding = 5; |
| 46 const int kTrayMenuBottomRowPaddingBetweenItems = -1; | 41 const int kTrayMenuBottomRowPaddingBetweenItems = -1; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 const int kTrayNotificationContentsWidth = | 76 const int kTrayNotificationContentsWidth = |
| 82 kTrayPopupMinWidth - (kNotificationIconWidth + kNotificationButtonWidth + | 77 kTrayPopupMinWidth - (kNotificationIconWidth + kNotificationButtonWidth + |
| 83 (kTrayPopupPaddingHorizontal / 2) * 3); | 78 (kTrayPopupPaddingHorizontal / 2) * 3); |
| 84 | 79 |
| 85 const int kMessageCenterBubblePadding = 4; | 80 const int kMessageCenterBubblePadding = 4; |
| 86 | 81 |
| 87 const int kTrayIconSize = 16; | 82 const int kTrayIconSize = 16; |
| 88 const SkColor kTrayIconColor = SK_ColorWHITE; | 83 const SkColor kTrayIconColor = SK_ColorWHITE; |
| 89 const int kMenuIconSize = 20; | 84 const int kMenuIconSize = 20; |
| 90 const SkColor kMenuIconColor = SkColorSetRGB(0x5A, 0x5A, 0x5A); | 85 const SkColor kMenuIconColor = SkColorSetRGB(0x5A, 0x5A, 0x5A); |
| 86 const int kMenuButtonSize = 48; |
| 91 | 87 |
| 92 const int kHitRegionPadding = 4; | 88 const int kHitRegionPadding = 4; |
| 93 const SkColor kSeparatorColor = SkColorSetA(SK_ColorWHITE, 0x4D); | 89 const SkColor kSeparatorColor = SkColorSetA(SK_ColorWHITE, 0x4D); |
| 94 const int kSeparatorWidth = 1; | 90 const int kSeparatorWidth = 1; |
| 95 | 91 |
| 96 int GetTrayConstant(TrayConstant constant) { | 92 int GetTrayConstant(TrayConstant constant) { |
| 97 const int kTrayItemHeightLegacy[] = {38, 38, kTrayItemSize}; | 93 const int kTrayItemHeightLegacy[] = {38, 38, kTrayItemSize}; |
| 98 const int kTraySpacing[] = {4, 4, 0}; | 94 const int kTraySpacing[] = {4, 4, 0}; |
| 99 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 4}; | 95 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 4}; |
| 100 const int kTrayPopupItemHeight[] = {46, 46, 48}; | 96 const int kTrayPopupItemHeight[] = {46, 46, 48}; |
| 101 const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize}; | 97 const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize}; |
| 98 const int kTrayImeMenuIcon[] = {40, 40, kTrayItemSize}; |
| 102 | 99 |
| 103 const int mode = MaterialDesignController::GetMode(); | 100 const int mode = MaterialDesignController::GetMode(); |
| 104 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && | 101 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && |
| 105 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); | 102 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); |
| 106 | 103 |
| 107 switch (constant) { | 104 switch (constant) { |
| 108 case TRAY_ITEM_HEIGHT_LEGACY: | 105 case TRAY_ITEM_HEIGHT_LEGACY: |
| 109 return kTrayItemHeightLegacy[mode]; | 106 return kTrayItemHeightLegacy[mode]; |
| 110 case TRAY_SPACING: | 107 case TRAY_SPACING: |
| 111 return kTraySpacing[mode]; | 108 return kTraySpacing[mode]; |
| 112 case TRAY_PADDING_FROM_EDGE_OF_SHELF: | 109 case TRAY_PADDING_FROM_EDGE_OF_SHELF: |
| 113 return kTrayPaddingFromEdgeOfShelf[mode]; | 110 return kTrayPaddingFromEdgeOfShelf[mode]; |
| 114 case TRAY_POPUP_ITEM_HEIGHT: | 111 case TRAY_POPUP_ITEM_HEIGHT: |
| 115 return kTrayPopupItemHeight[mode]; | 112 return kTrayPopupItemHeight[mode]; |
| 116 case VIRTUAL_KEYBOARD_BUTTON_SIZE: | 113 case VIRTUAL_KEYBOARD_BUTTON_SIZE: |
| 117 return kVirtualKeyboardButtonSize[mode]; | 114 return kVirtualKeyboardButtonSize[mode]; |
| 115 case TRAY_IME_MENU_ICON: |
| 116 return kTrayImeMenuIcon[mode]; |
| 118 } | 117 } |
| 119 NOTREACHED(); | 118 NOTREACHED(); |
| 120 return 0; | 119 return 0; |
| 121 } | 120 } |
| 122 | 121 |
| 123 } // namespace ash | 122 } // namespace ash |
| OLD | NEW |