| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 const int kHitRegionPadding = 4; | 87 const int kHitRegionPadding = 4; |
| 93 const SkColor kSeparatorColor = SkColorSetA(SK_ColorWHITE, 0x4D); | 88 const SkColor kSeparatorColor = SkColorSetA(SK_ColorWHITE, 0x4D); |
| 94 const int kSeparatorWidth = 1; | 89 const int kSeparatorWidth = 1; |
| 95 | 90 |
| 96 int GetTrayConstant(TrayConstant constant) { | 91 int GetTrayConstant(TrayConstant constant) { |
| 97 const int kTrayItemHeightLegacy[] = {38, 38, kTrayItemSize}; | 92 const int kTrayItemHeightLegacy[] = {38, 38, kTrayItemSize}; |
| 98 const int kTraySpacing[] = {4, 4, 0}; | 93 const int kTraySpacing[] = {4, 4, 0}; |
| 99 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 4}; | 94 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 4}; |
| 100 const int kTrayPopupItemHeight[] = {46, 46, 48}; | 95 const int kTrayPopupItemHeight[] = {46, 46, 48}; |
| 101 const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize}; | 96 const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize}; |
| 97 const int kTrayImeMenuIcon[] = {40, 40, kTrayItemSize}; |
| 102 | 98 |
| 103 const int mode = MaterialDesignController::GetMode(); | 99 const int mode = MaterialDesignController::GetMode(); |
| 104 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && | 100 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && |
| 105 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); | 101 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); |
| 106 | 102 |
| 107 switch (constant) { | 103 switch (constant) { |
| 108 case TRAY_ITEM_HEIGHT_LEGACY: | 104 case TRAY_ITEM_HEIGHT_LEGACY: |
| 109 return kTrayItemHeightLegacy[mode]; | 105 return kTrayItemHeightLegacy[mode]; |
| 110 case TRAY_SPACING: | 106 case TRAY_SPACING: |
| 111 return kTraySpacing[mode]; | 107 return kTraySpacing[mode]; |
| 112 case TRAY_PADDING_FROM_EDGE_OF_SHELF: | 108 case TRAY_PADDING_FROM_EDGE_OF_SHELF: |
| 113 return kTrayPaddingFromEdgeOfShelf[mode]; | 109 return kTrayPaddingFromEdgeOfShelf[mode]; |
| 114 case TRAY_POPUP_ITEM_HEIGHT: | 110 case TRAY_POPUP_ITEM_HEIGHT: |
| 115 return kTrayPopupItemHeight[mode]; | 111 return kTrayPopupItemHeight[mode]; |
| 116 case VIRTUAL_KEYBOARD_BUTTON_SIZE: | 112 case VIRTUAL_KEYBOARD_BUTTON_SIZE: |
| 117 return kVirtualKeyboardButtonSize[mode]; | 113 return kVirtualKeyboardButtonSize[mode]; |
| 114 case TRAY_IME_MENU_ICON: |
| 115 return kTrayImeMenuIcon[mode]; |
| 118 } | 116 } |
| 119 NOTREACHED(); | 117 NOTREACHED(); |
| 120 return 0; | 118 return 0; |
| 121 } | 119 } |
| 122 | 120 |
| 123 } // namespace ash | 121 } // namespace ash |
| OLD | NEW |