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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "third_party/skia/include/core/SkColor.h" | 8 #include "third_party/skia/include/core/SkColor.h" |
9 #include "ui/gfx/color_palette.h" | 9 #include "ui/gfx/color_palette.h" |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
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 kTrayImageItemHorizontalPaddingVerticalAlignment = 1; | 28 const int kTrayImageItemHorizontalPaddingVerticalAlignment = 1; |
29 | 29 |
30 // Size of tray items on the primary axis. | 30 // Size of tray items on the primary axis. |
31 const int kTrayItemSize = 32; | 31 const int kTrayItemSize = 32; |
32 | 32 |
| 33 const int kTrayImageItemPadding = 3; |
| 34 |
33 const int kTrayLabelItemHorizontalPaddingBottomAlignment = 7; | 35 const int kTrayLabelItemHorizontalPaddingBottomAlignment = 7; |
34 | 36 |
35 // Vertical padding between status tray items when the shelf is vertical. | 37 // Vertical padding between status tray items when the shelf is vertical. |
36 const int kTrayLabelItemVerticalPaddingVerticalAlignment = 4; | 38 const int kTrayLabelItemVerticalPaddingVerticalAlignment = 4; |
37 | 39 |
38 const int kTrayMenuBottomRowPadding = 3; | 40 const int kTrayMenuBottomRowPadding = 3; |
39 const int kTrayMenuBottomRowPaddingBetweenItems = -1; | 41 const int kTrayMenuBottomRowPaddingBetweenItems = -1; |
40 const int kTrayMenuMinimumWidth = 300; | 42 const int kTrayMenuMinimumWidth = 300; |
41 const int kTrayMenuMinimumWidthMd = 352; | 43 const int kTrayMenuMinimumWidthMd = 352; |
42 | 44 |
43 const int kTrayPopupAutoCloseDelayInSeconds = 2; | 45 const int kTrayPopupAutoCloseDelayInSeconds = 2; |
44 const int kTrayPopupAutoCloseDelayForTextInSeconds = 5; | 46 const int kTrayPopupAutoCloseDelayForTextInSeconds = 5; |
45 const int kTrayPopupPaddingHorizontal = 18; | 47 const int kTrayPopupPaddingHorizontal = 18; |
46 const int kTrayPopupPaddingBetweenItems = 10; | 48 const int kTrayPopupPaddingBetweenItems = 10; |
47 const int kTrayPopupButtonEndMargin = 10; | 49 const int kTrayPopupButtonEndMargin = 10; |
48 const int kTrayPopupLabelHorizontalPadding = 4; | 50 const int kTrayPopupLabelHorizontalPadding = 4; |
| 51 const int kTrayPopupItemMinHeight = 48; |
| 52 const int kTrayPopupItemMinStartWidth = 48; |
| 53 const int kTrayPopupItemMinEndWidth = |
| 54 kMenuIconSize + 2 * kTrayPopupButtonEndMargin; |
49 | 55 |
50 const int kTrayDetailedViewTransitionDelayMs = 100; | 56 const int kTrayDetailedViewTransitionDelayMs = 100; |
51 | 57 |
52 const int kTrayPopupLabelRightPadding = 8; | 58 const int kTrayPopupLabelRightPadding = 8; |
53 | 59 |
54 const int kTrayPopupDetailsIconWidth = 25; | 60 const int kTrayPopupDetailsIconWidth = 25; |
55 const int kTrayPopupDetailsLabelExtraLeftMargin = 8; | 61 const int kTrayPopupDetailsLabelExtraLeftMargin = 8; |
56 const SkColor kTrayPopupHoverBackgroundColor = SkColorSetRGB(0xe4, 0xe4, 0xe4); | 62 const SkColor kTrayPopupHoverBackgroundColor = SkColorSetRGB(0xe4, 0xe4, 0xe4); |
57 const int kTrayPopupScrollSeparatorHeight = 15; | 63 const int kTrayPopupScrollSeparatorHeight = 15; |
58 const int kTrayRoundedBorderRadius = 2; | 64 const int kTrayRoundedBorderRadius = 2; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 const SkColor kMenuSeparatorColor = SkColorSetA(SK_ColorBLACK, 0x1F); | 106 const SkColor kMenuSeparatorColor = SkColorSetA(SK_ColorBLACK, 0x1F); |
101 | 107 |
102 const SkColor kTrayPopupInkDropBaseColor = SK_ColorBLACK; | 108 const SkColor kTrayPopupInkDropBaseColor = SK_ColorBLACK; |
103 const float kTrayPopupInkDropRippleOpacity = 0.06f; | 109 const float kTrayPopupInkDropRippleOpacity = 0.06f; |
104 const float kTrayPopupInkDropHighlightOpacity = 0.08f; | 110 const float kTrayPopupInkDropHighlightOpacity = 0.08f; |
105 const int kTrayPopupInkDropInset = 4; | 111 const int kTrayPopupInkDropInset = 4; |
106 const int kTrayPopupInkDropCornerRadius = 2; | 112 const int kTrayPopupInkDropCornerRadius = 2; |
107 | 113 |
108 const int kTrayPopupSystemInfoRowHeight = 40; | 114 const int kTrayPopupSystemInfoRowHeight = 40; |
109 | 115 |
110 int GetTrayConstant(TrayConstant constant) { | |
111 const int kTrayItemHeightLegacy[] = {38, kTrayItemSize, kTrayItemSize}; | |
112 const int kTrayPaddingFromEdgeOfShelf[] = {3, 3, 3}; | |
113 const int kTrayPopupItemMinHeight[] = {46, 48, 48}; | |
114 const int kTrayPopupItemMaxHeight[] = {138, 144, 144}; | |
115 // FixedSizedImageViews use the contained ImageView's width for 0 values. | |
116 const int kTrayPopupItemMainImageRegionWidth[] = {0, 48, 48}; | |
117 const int kTrayPopupItemMoreImageSize[] = {25, kMenuIconSize, kMenuIconSize}; | |
118 const int kTrayPopupItemMoreRegionHorizontalInset[] = {10, 10, 10}; | |
119 const int kTrayPopupItemLeftInset[] = {0, 4, 4}; | |
120 const int kTrayPopupItemMinStartWidth[] = {46, 48, 48}; | |
121 const int kTrayPopupItemMinEndWidth[] = {40, 40, 40}; | |
122 const int kTrayImeMenuIcon[] = {40, kTrayItemSize, kTrayItemSize}; | |
123 const int kTrayImageItemPadding[] = {1, 3, 3}; | |
124 | |
125 // TODO(estade): clean this up --- remove unneeded constants and reduce | |
126 // remaining arrays to a single constant. | |
127 const int mode = 1; | |
128 switch (constant) { | |
129 case TRAY_ITEM_HEIGHT_LEGACY: | |
130 return kTrayItemHeightLegacy[mode]; | |
131 case TRAY_PADDING_FROM_EDGE_OF_SHELF: | |
132 return kTrayPaddingFromEdgeOfShelf[mode]; | |
133 case TRAY_POPUP_ITEM_MIN_HEIGHT: | |
134 return kTrayPopupItemMinHeight[mode]; | |
135 case TRAY_POPUP_ITEM_MAX_HEIGHT: | |
136 return kTrayPopupItemMaxHeight[mode]; | |
137 case TRAY_POPUP_ITEM_MAIN_IMAGE_CONTAINER_WIDTH: | |
138 return kTrayPopupItemMainImageRegionWidth[mode]; | |
139 case TRAY_POPUP_ITEM_MORE_IMAGE_SIZE: | |
140 return kTrayPopupItemMoreImageSize[mode]; | |
141 case TRAY_POPUP_ITEM_MORE_REGION_HORIZONTAL_INSET: | |
142 return kTrayPopupItemMoreRegionHorizontalInset[mode]; | |
143 case TRAY_POPUP_ITEM_LEFT_INSET: | |
144 return kTrayPopupItemLeftInset[mode]; | |
145 case TRAY_POPUP_ITEM_MIN_START_WIDTH: | |
146 return kTrayPopupItemMinStartWidth[mode]; | |
147 case TRAY_POPUP_ITEM_MIN_END_WIDTH: | |
148 return kTrayPopupItemMinEndWidth[mode]; | |
149 case TRAY_IME_MENU_ICON: | |
150 return kTrayImeMenuIcon[mode]; | |
151 case TRAY_IMAGE_ITEM_PADDING: | |
152 return kTrayImageItemPadding[mode]; | |
153 } | |
154 NOTREACHED(); | |
155 return 0; | |
156 } | |
157 | |
158 } // namespace ash | 116 } // namespace ash |
OLD | NEW |