| 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 #include "ui/gfx/color_palette.h" | 10 #include "ui/gfx/color_palette.h" |
| 11 | 11 |
| 12 namespace ash { | 12 namespace ash { |
| 13 | 13 |
| 14 const int kPaddingFromRightEdgeOfScreenBottomAlignment = 7; | 14 const int kPaddingFromRightEdgeOfScreenBottomAlignment = 7; |
| 15 const int kPaddingFromBottomOfScreenBottomAlignment = 7; | 15 const int kPaddingFromBottomOfScreenBottomAlignment = 7; |
| 16 const int kPaddingFromOuterEdgeOfLauncherVerticalAlignment = 8; | 16 const int kPaddingFromOuterEdgeOfLauncherVerticalAlignment = 8; |
| 17 const int kPaddingFromInnerEdgeOfLauncherVerticalAlignment = 9; | 17 const int kPaddingFromInnerEdgeOfLauncherVerticalAlignment = 9; |
| 18 const int kPaddingFromBottomOfScreenVerticalAlignment = 10; | 18 const int kPaddingFromBottomOfScreenVerticalAlignment = 10; |
| 19 | 19 |
| 20 // Padding used to position the system menu relative to the status area. | 20 // Padding used to position the system menu relative to the status area. |
| 21 const int kBubblePaddingHorizontalBottom = 6; | 21 const int kBubblePaddingHorizontalBottom = 6; |
| 22 const int kBubblePaddingHorizontalSide = 10; | 22 const int kBubblePaddingHorizontalSide = 10; |
| 23 const int kBubblePaddingVerticalBottom = 3; | 23 const int kBubblePaddingVerticalBottom = 3; |
| 24 const int kBubblePaddingVerticalSide = 15; | 24 const int kBubblePaddingVerticalSide = 15; |
| 25 | 25 |
| 26 // Top inset of system tray bubble for bottom anchor alignment. | 26 // Top inset of system tray bubble for bottom anchor alignment. |
| 27 const int kTrayBubbleAnchorTopInsetBottomAnchor = 3; | 27 const int kTrayBubbleAnchorTopInsetBottomAnchor = 3; |
| 28 | 28 |
| 29 const int kTrayImageItemHorizontalPaddingBottomAlignment = 1; | |
| 30 const int kTrayImageItemHorizontalPaddingVerticalAlignment = 1; | 29 const int kTrayImageItemHorizontalPaddingVerticalAlignment = 1; |
| 31 const int kTrayImageItemVerticalPaddingVerticalAlignment = 1; | |
| 32 | 30 |
| 33 // Size of tray items on the primary axis. | 31 // Size of tray items on the primary axis. |
| 34 const int kTrayItemSize = 32; | 32 const int kTrayItemSize = 32; |
| 35 | 33 |
| 36 const int kTrayLabelItemHorizontalPaddingBottomAlignment = 7; | 34 const int kTrayLabelItemHorizontalPaddingBottomAlignment = 7; |
| 37 | 35 |
| 38 // Vertical padding between status tray items when the shelf is vertical. | 36 // Vertical padding between status tray items when the shelf is vertical. |
| 39 const int kTrayLabelItemVerticalPaddingVerticalAlignment = 4; | 37 const int kTrayLabelItemVerticalPaddingVerticalAlignment = 4; |
| 40 | 38 |
| 41 const int kTrayMenuBottomRowPadding = 5; | 39 const int kTrayMenuBottomRowPadding = 5; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 const SkColor kSeparatorColor = SkColorSetA(SK_ColorWHITE, 0x4D); | 89 const SkColor kSeparatorColor = SkColorSetA(SK_ColorWHITE, 0x4D); |
| 92 const int kSeparatorWidth = 1; | 90 const int kSeparatorWidth = 1; |
| 93 | 91 |
| 94 int GetTrayConstant(TrayConstant constant) { | 92 int GetTrayConstant(TrayConstant constant) { |
| 95 const int kTrayItemHeightLegacy[] = {38, 38, kTrayItemSize}; | 93 const int kTrayItemHeightLegacy[] = {38, 38, kTrayItemSize}; |
| 96 const int kTraySpacing[] = {4, 4, 0}; | 94 const int kTraySpacing[] = {4, 4, 0}; |
| 97 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 4}; | 95 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 4}; |
| 98 const int kTrayPopupItemHeight[] = {46, 46, 48}; | 96 const int kTrayPopupItemHeight[] = {46, 46, 48}; |
| 99 const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize}; | 97 const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize}; |
| 100 const int kTrayImeMenuIcon[] = {40, 40, kTrayItemSize}; | 98 const int kTrayImeMenuIcon[] = {40, 40, kTrayItemSize}; |
| 99 const int kTrayImageItemPadding[] = {1, 1, 3}; |
| 101 | 100 |
| 102 const int mode = MaterialDesignController::GetMode(); | 101 const int mode = MaterialDesignController::GetMode(); |
| 103 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && | 102 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && |
| 104 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); | 103 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); |
| 105 | 104 |
| 106 switch (constant) { | 105 switch (constant) { |
| 107 case TRAY_ITEM_HEIGHT_LEGACY: | 106 case TRAY_ITEM_HEIGHT_LEGACY: |
| 108 return kTrayItemHeightLegacy[mode]; | 107 return kTrayItemHeightLegacy[mode]; |
| 109 case TRAY_SPACING: | 108 case TRAY_SPACING: |
| 110 return kTraySpacing[mode]; | 109 return kTraySpacing[mode]; |
| 111 case TRAY_PADDING_FROM_EDGE_OF_SHELF: | 110 case TRAY_PADDING_FROM_EDGE_OF_SHELF: |
| 112 return kTrayPaddingFromEdgeOfShelf[mode]; | 111 return kTrayPaddingFromEdgeOfShelf[mode]; |
| 113 case TRAY_POPUP_ITEM_HEIGHT: | 112 case TRAY_POPUP_ITEM_HEIGHT: |
| 114 return kTrayPopupItemHeight[mode]; | 113 return kTrayPopupItemHeight[mode]; |
| 115 case VIRTUAL_KEYBOARD_BUTTON_SIZE: | 114 case VIRTUAL_KEYBOARD_BUTTON_SIZE: |
| 116 return kVirtualKeyboardButtonSize[mode]; | 115 return kVirtualKeyboardButtonSize[mode]; |
| 117 case TRAY_IME_MENU_ICON: | 116 case TRAY_IME_MENU_ICON: |
| 118 return kTrayImeMenuIcon[mode]; | 117 return kTrayImeMenuIcon[mode]; |
| 118 case TRAY_IMAGE_ITEM_PADDING: |
| 119 return kTrayImageItemPadding[mode]; |
| 119 } | 120 } |
| 120 NOTREACHED(); | 121 NOTREACHED(); |
| 121 return 0; | 122 return 0; |
| 122 } | 123 } |
| 123 | 124 |
| 124 } // namespace ash | 125 } // namespace ash |
| OLD | NEW |