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" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 const int kTrayPopupTextSpacingVertical = 4; | 46 const int kTrayPopupTextSpacingVertical = 4; |
47 const int kTrayPopupUserCardVerticalPadding = 10; | 47 const int kTrayPopupUserCardVerticalPadding = 10; |
48 const int kTrayPopupSliderPaddingMD = 16; | 48 const int kTrayPopupSliderPaddingMD = 16; |
49 | 49 |
50 const int kTrayPopupDetailsIconWidth = 25; | 50 const int kTrayPopupDetailsIconWidth = 25; |
51 const int kTrayPopupDetailsLabelExtraLeftMargin = 8; | 51 const int kTrayPopupDetailsLabelExtraLeftMargin = 8; |
52 const SkColor kTrayPopupHoverBackgroundColor = SkColorSetRGB(0xe4, 0xe4, 0xe4); | 52 const SkColor kTrayPopupHoverBackgroundColor = SkColorSetRGB(0xe4, 0xe4, 0xe4); |
53 const int kTrayPopupScrollSeparatorHeight = 15; | 53 const int kTrayPopupScrollSeparatorHeight = 15; |
54 const int kTrayRoundedBorderRadius = 2; | 54 const int kTrayRoundedBorderRadius = 2; |
55 | 55 |
56 const int kTrayPopupLabelHorizontalPadding = 4; | |
tdanderson
2016/11/01 18:59:43
I think this may be a duplicate of kTrayPopupTextS
bruthig
2016/11/01 23:00:43
kTrayPopupTextSpacingVertical doesn't appear to be
| |
57 | |
56 const SkColor kBackgroundColor = SkColorSetRGB(0xfe, 0xfe, 0xfe); | 58 const SkColor kBackgroundColor = SkColorSetRGB(0xfe, 0xfe, 0xfe); |
57 const SkColor kHoverBackgroundColor = SkColorSetRGB(0xf3, 0xf3, 0xf3); | 59 const SkColor kHoverBackgroundColor = SkColorSetRGB(0xf3, 0xf3, 0xf3); |
58 const SkColor kPublicAccountBackgroundColor = SkColorSetRGB(0xf8, 0xe5, 0xb6); | 60 const SkColor kPublicAccountBackgroundColor = SkColorSetRGB(0xf8, 0xe5, 0xb6); |
59 const SkColor kPublicAccountUserCardTextColor = SkColorSetRGB(0x66, 0x66, 0x66); | 61 const SkColor kPublicAccountUserCardTextColor = SkColorSetRGB(0x66, 0x66, 0x66); |
60 const SkColor kPublicAccountUserCardNameColor = SK_ColorBLACK; | 62 const SkColor kPublicAccountUserCardNameColor = SK_ColorBLACK; |
61 | 63 |
62 const SkColor kHeaderBackgroundColor = SkColorSetRGB(0xf5, 0xf5, 0xf5); | 64 const SkColor kHeaderBackgroundColor = SkColorSetRGB(0xf5, 0xf5, 0xf5); |
63 | 65 |
64 const SkColor kBorderDarkColor = SkColorSetRGB(0xaa, 0xaa, 0xaa); | 66 const SkColor kBorderDarkColor = SkColorSetRGB(0xaa, 0xaa, 0xaa); |
65 const SkColor kBorderLightColor = SkColorSetRGB(0xeb, 0xeb, 0xeb); | 67 const SkColor kBorderLightColor = SkColorSetRGB(0xeb, 0xeb, 0xeb); |
(...skipping 28 matching lines...) Expand all Loading... | |
94 | 96 |
95 const SkColor kTrayPopupInkDropBaseColor = SK_ColorBLACK; | 97 const SkColor kTrayPopupInkDropBaseColor = SK_ColorBLACK; |
96 const float kTrayPopupInkDropRippleOpacity = 0.06f; | 98 const float kTrayPopupInkDropRippleOpacity = 0.06f; |
97 const float kTrayPopupInkDropHighlightOpacity = 0.08f; | 99 const float kTrayPopupInkDropHighlightOpacity = 0.08f; |
98 const int kTrayPopupInkDropInset = 4; | 100 const int kTrayPopupInkDropInset = 4; |
99 | 101 |
100 int GetTrayConstant(TrayConstant constant) { | 102 int GetTrayConstant(TrayConstant constant) { |
101 const int kTrayItemHeightLegacy[] = {38, 38, kTrayItemSize}; | 103 const int kTrayItemHeightLegacy[] = {38, 38, kTrayItemSize}; |
102 const int kTraySpacing[] = {4, 4, 0}; | 104 const int kTraySpacing[] = {4, 4, 0}; |
103 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 4}; | 105 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 4}; |
104 const int kTrayPopupItemHeight[] = {46, 46, 48}; | 106 const int kTrayPopupItemHeight[] = {46, 48, 48}; |
tdanderson
2016/11/01 18:59:44
Note that since these arrays have the form {a, b,
bruthig
2016/11/01 23:00:43
Acknowledged.
| |
105 // TODO(bruthig): Use the correct values for non-material design. | 107 // FixedSizedImageViews use the contained ImageView's width for 0 values. |
108 const int kTrayPopupItemMainImageRegionWidth[] = {0, 48, 48}; | |
109 // FixedSizedImageViews use the contained ImageView's width for 0 values. | |
110 const int kTrayPopupItemMoreImageRegionWidth[] = {0, 20, 20}; | |
106 const int kTrayPopupItemLeftInset[] = {0, 0, 4}; | 111 const int kTrayPopupItemLeftInset[] = {0, 0, 4}; |
107 // TODO(bruthig): Use the correct values for non-material design. | 112 const int kTrayPopupItemRightInset[] = {0, 0, 0}; |
108 const int kTrayPopupItemRightInset[] = {0, 0, 4}; | 113 const int kTrayPopupItemMinStartWidth[] = {46, 48, 48}; |
109 // TODO(bruthig): Use the correct values for non-material design. | 114 const int kTrayPopupItemMinEndWidth[] = {40, 40, 40}; |
110 const int kTrayPopupItemMinStartWidth[] = {48, 48, 48}; | |
111 // TODO(bruthig): Use the correct values for non-material design. | |
112 const int kTrayPopupItemMinEndWidth[] = {48, 48, 48}; | |
113 const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize}; | 115 const int kVirtualKeyboardButtonSize[] = {39, 39, kTrayItemSize}; |
114 const int kTrayImeMenuIcon[] = {40, 40, kTrayItemSize}; | 116 const int kTrayImeMenuIcon[] = {40, 40, kTrayItemSize}; |
115 const int kTrayImageItemPadding[] = {1, 1, 3}; | 117 const int kTrayImageItemPadding[] = {1, 1, 3}; |
116 | 118 |
117 const int mode = MaterialDesignController::GetMode(); | 119 const int mode = MaterialDesignController::GetMode(); |
118 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && | 120 DCHECK(mode >= MaterialDesignController::NON_MATERIAL && |
119 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); | 121 mode <= MaterialDesignController::MATERIAL_EXPERIMENTAL); |
120 | 122 |
121 switch (constant) { | 123 switch (constant) { |
122 case TRAY_ITEM_HEIGHT_LEGACY: | 124 case TRAY_ITEM_HEIGHT_LEGACY: |
123 return kTrayItemHeightLegacy[mode]; | 125 return kTrayItemHeightLegacy[mode]; |
124 case TRAY_SPACING: | 126 case TRAY_SPACING: |
125 return kTraySpacing[mode]; | 127 return kTraySpacing[mode]; |
126 case TRAY_PADDING_FROM_EDGE_OF_SHELF: | 128 case TRAY_PADDING_FROM_EDGE_OF_SHELF: |
127 return kTrayPaddingFromEdgeOfShelf[mode]; | 129 return kTrayPaddingFromEdgeOfShelf[mode]; |
128 case TRAY_POPUP_ITEM_HEIGHT: | 130 case TRAY_POPUP_ITEM_HEIGHT: |
129 return kTrayPopupItemHeight[mode]; | 131 return kTrayPopupItemHeight[mode]; |
132 case TRAY_POPUP_ITEM_MAIN_IMAGE_CONTAINER_WIDTH: | |
133 return kTrayPopupItemMainImageRegionWidth[mode]; | |
134 case TRAY_POPUP_ITEM_MORE_IMAGE_CONTAINER_WIDTH: | |
135 return kTrayPopupItemMoreImageRegionWidth[mode]; | |
130 case TRAY_POPUP_ITEM_LEFT_INSET: | 136 case TRAY_POPUP_ITEM_LEFT_INSET: |
131 return kTrayPopupItemLeftInset[mode]; | 137 return kTrayPopupItemLeftInset[mode]; |
132 case TRAY_POPUP_ITEM_RIGHT_INSET: | 138 case TRAY_POPUP_ITEM_RIGHT_INSET: |
133 return kTrayPopupItemRightInset[mode]; | 139 return kTrayPopupItemRightInset[mode]; |
134 case TRAY_POPUP_ITEM_MIN_START_WIDTH: | 140 case TRAY_POPUP_ITEM_MIN_START_WIDTH: |
135 return kTrayPopupItemMinStartWidth[mode]; | 141 return kTrayPopupItemMinStartWidth[mode]; |
136 case TRAY_POPUP_ITEM_MIN_END_WIDTH: | 142 case TRAY_POPUP_ITEM_MIN_END_WIDTH: |
137 return kTrayPopupItemMinEndWidth[mode]; | 143 return kTrayPopupItemMinEndWidth[mode]; |
138 case VIRTUAL_KEYBOARD_BUTTON_SIZE: | 144 case VIRTUAL_KEYBOARD_BUTTON_SIZE: |
139 return kVirtualKeyboardButtonSize[mode]; | 145 return kVirtualKeyboardButtonSize[mode]; |
140 case TRAY_IME_MENU_ICON: | 146 case TRAY_IME_MENU_ICON: |
141 return kTrayImeMenuIcon[mode]; | 147 return kTrayImeMenuIcon[mode]; |
142 case TRAY_IMAGE_ITEM_PADDING: | 148 case TRAY_IMAGE_ITEM_PADDING: |
143 return kTrayImageItemPadding[mode]; | 149 return kTrayImageItemPadding[mode]; |
144 } | 150 } |
145 NOTREACHED(); | 151 NOTREACHED(); |
146 return 0; | 152 return 0; |
147 } | 153 } |
148 | 154 |
149 } // namespace ash | 155 } // namespace ash |
OLD | NEW |