tray_constants.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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
  3. // found in the LICENSE file.
  4. #ifndef ASH_SYSTEM_TRAY_TRAY_CONSTANTS_H_
  5. #define ASH_SYSTEM_TRAY_TRAY_CONSTANTS_H_
  6. #include "ash/ash_export.h"
  7. #include "ui/gfx/color_palette.h"
  8. #include "ui/gfx/geometry/insets.h"
  9. #include "ui/gfx/geometry/size.h"
  10. namespace ash {
  11. // Do not add constant colors in this file. Get the colors from AshColorProvider
  12. // instead.
  13. // The size delta between the default font and the font size found in tray
  14. // items like labels and buttons.
  15. extern const int kTrayTextFontSizeIncrease;
  16. ASH_EXPORT extern const int kTrayItemSize;
  17. extern const float kTrayItemCornerRadius;
  18. // Extra padding used beside a single icon in the tray area of the shelf.
  19. constexpr int kTrayImageItemPadding = 3;
  20. // The width of the tray menu.
  21. constexpr int kTrayMenuWidth = 360;
  22. extern const int kTrayPopupAutoCloseDelayInSeconds;
  23. extern const int kTrayPopupAutoCloseDelayInSecondsWithSpokenFeedback;
  24. extern const int kTrayPopupPaddingHorizontal;
  25. extern const int kTrayPopupButtonEndMargin;
  26. // The padding used on the left and right of labels. This applies to all labels
  27. // in the system menu.
  28. extern const int kTrayPopupLabelHorizontalPadding;
  29. // The horizontal padding used to properly lay out a slider in a TriView
  30. // container with a FillLayout (such as a volume notification bubble).
  31. extern const int kTrayPopupSliderHorizontalPadding;
  32. // The minimum/default height of the rows in the system tray menu.
  33. extern const int kTrayPopupItemMinHeight;
  34. // The width used for the first region of the row (which holds an image).
  35. extern const int kTrayPopupItemMinStartWidth;
  36. // The width used for the end region of the row (usually a more arrow).
  37. extern const int kTrayPopupItemMinEndWidth;
  38. // Padding used on right side of labels to keep minimum distance to the next
  39. // item. This applies to all labels in the system menu.
  40. extern const int kTrayPopupLabelRightPadding;
  41. // The width of ToggleButton views including any border padding.
  42. extern const int kTrayToggleButtonWidth;
  43. // Constants for the title row.
  44. constexpr int kTitleRowProgressBarHeight = 2;
  45. // Width of lines used to separate menu items (e.g. input method menu).
  46. constexpr int kMenuSeparatorWidth = 1;
  47. // Width of lines used to separate sections of the system tray, for instance
  48. // in tray detailed views.
  49. constexpr int kTraySeparatorWidth = 0;
  50. // The size of the icons appearing in the material design system tray.
  51. constexpr int kTrayIconSize = 16;
  52. // The padding on top of the time tray icon when vertically aligned.
  53. constexpr int kTrayTimeIconTopPadding = 2;
  54. // The padding around network tray icon in dip.
  55. constexpr int kTrayNetworkIconPadding = 2;
  56. constexpr int kUnifiedTrayNetworkIconPadding = 4;
  57. // The size of the icons appearing in the material design system menu.
  58. extern const int kMenuIconSize;
  59. // The size of buttons in the system menu.
  60. ASH_EXPORT extern const int kMenuButtonSize;
  61. // The vertical padding for the system menu separator.
  62. extern const int kMenuSeparatorVerticalPadding;
  63. // The horizontal padding for the system menu separator.
  64. extern const int kMenuExtraMarginFromLeftEdge;
  65. // The visual padding to the left of icons in the system menu.
  66. extern const int kMenuEdgeEffectivePadding;
  67. // The inset applied to clickable surfaces in the system menu that do not have
  68. // the ink drop filling the entire bounds.
  69. extern const int kTrayPopupInkDropInset;
  70. // The radius used to draw the corners of the rounded rect style ink drops.
  71. extern const int kTrayPopupInkDropCornerRadius;
  72. // Threshold to ignore update on the slider value.
  73. constexpr float kAudioSliderIgnoreUpdateThreshold = 0.01;
  74. // Duration for the collapse / expand animation in ms.
  75. constexpr int kSystemMenuCollapseExpandAnimationDurationMs = 500;
  76. constexpr auto kUnifiedMenuItemPadding = gfx::Insets::TLBR(0, 16, 16, 16);
  77. constexpr auto kUnifiedSystemInfoViewPadding = gfx::Insets::TLBR(0, 16, 16, 16);
  78. constexpr auto kUnifiedManagedDeviceViewPadding =
  79. gfx::Insets::TLBR(0, 16, 11, 16);
  80. constexpr auto kUnifiedSliderRowPadding = gfx::Insets::TLBR(0, 12, 8, 16);
  81. constexpr auto kUnifiedSliderBubblePadding = gfx::Insets::TLBR(12, 0, 4, 0);
  82. constexpr auto kUnifiedSliderPadding = gfx::Insets::VH(0, 16);
  83. constexpr auto kMicGainSliderViewPadding = gfx::Insets::TLBR(0, 52, 8, 0);
  84. constexpr auto kMicGainSliderPadding = gfx::Insets::TLBR(0, 8, 0, 48);
  85. constexpr int kMicGainSliderViewSpacing = 8;
  86. constexpr int kTrayRadioButtonInterSpacing = 20;
  87. constexpr auto kTrayRadioButtonPadding = gfx::Insets::TLBR(16, 20, 0, 0);
  88. constexpr auto kTraySubLabelPadding = gfx::Insets::TLBR(4, 56, 16, 16);
  89. constexpr int kMessageCenterCollapseThreshold = 175;
  90. constexpr int kStackedNotificationBarHeight = 32;
  91. constexpr int kStackedNotificationBarCollapsedHeight = 40;
  92. constexpr int kNotificationIconStackThreshold = 28;
  93. constexpr int kUnifiedSliderViewSpacing = 12;
  94. constexpr int kUnifiedMessageCenterBubbleSpacing = 8;
  95. constexpr int kUnifiedNotificationCenterSpacing = 16;
  96. constexpr int kUnifiedTrayBatteryIconSize = 20;
  97. constexpr int kUnifiedTrayIconSize = 18;
  98. constexpr int kUnifiedTrayNonRoundedSideRadius = 4;
  99. constexpr int kUnifiedTraySubIconSize = 15;
  100. constexpr int kUnifiedTrayTextTopPadding = 1;
  101. constexpr int kUnifiedTrayTextRightPadding = 1;
  102. constexpr int kUnifiedTrayTimeLeftPadding = 1;
  103. constexpr int kUnifiedTraySpacingBetweenIcons = 6;
  104. constexpr int kUnifiedTrayBatteryWidth = 12;
  105. constexpr int kUnifiedTrayBatteryBottomPadding = 1;
  106. constexpr int kUnifiedTrayChannelIndicatorDimension = 16;
  107. constexpr int kUnifiedTrayContentPadding = 12;
  108. constexpr int kUnifiedTopShortcutSpacing = 16;
  109. constexpr int kUnifiedNotificationHiddenLineHeight = 20;
  110. constexpr int kUnifiedTopShortcutContainerTopPadding = 12;
  111. constexpr int kUnifiedNotificationMinimumHeight = 40;
  112. constexpr int kUnifiedBackButtonLeftPadding = 16;
  113. constexpr auto kUnifiedTopShortcutPadding = gfx::Insets::VH(0, 16);
  114. constexpr auto kUnifiedNotificationHiddenPadding = gfx::Insets::VH(6, 16);
  115. constexpr gfx::Insets kUnifiedCircularButtonFocusPadding(4);
  116. constexpr gfx::Insets kTrayBackgroundFocusPadding(1);
  117. constexpr gfx::Insets kUnifiedSystemInfoBatteryIconPadding =
  118. gfx::Insets::TLBR(2, 2, 2, 6);
  119. // Size of an icon drawn inside top shortcut buttons.
  120. // A dark disc with |kTrayItemSize| diameter is drawn in the background.
  121. constexpr int kTrayTopShortcutButtonIconSize = 20;
  122. constexpr int kUnifiedManagedDeviceSpacing = 8;
  123. constexpr int kUnifiedSystemInfoHeight = 16;
  124. constexpr int kUnifiedSystemInfoSpacing = 8;
  125. constexpr gfx::Insets kUnifiedSystemInfoDateViewPadding(3);
  126. // Constants used in StackedNotificationBar located on top of the message
  127. // center.
  128. constexpr auto kStackedNotificationIconsContainerPadding =
  129. gfx::Insets::TLBR(1, 14, 0, 8);
  130. constexpr int kStackedNotificationBarMaxIcons = 3;
  131. constexpr int kStackedNotificationBarIconSpacing = 6;
  132. constexpr int kStackedNotificationIconSize = 18;
  133. constexpr int kNotificationIconAnimationLowPosition = 7;
  134. constexpr int kNotificationIconAnimationHighPosition = -3;
  135. constexpr double kNotificationIconAnimationScaleFactor = 0.77;
  136. constexpr int kNotificationIconAnimationUpDurationMs = 50;
  137. constexpr int kNotificationIconAnimationDownDurationMs = 17;
  138. constexpr int kNotificationIconAnimationOutDurationMs = 67;
  139. constexpr double kNotificationCenterDragExpandThreshold = 0.8;
  140. // Constants used in FeaturePodsView of UnifiedSystemTray.
  141. constexpr gfx::Size kUnifiedFeaturePodSize(112, 94);
  142. constexpr gfx::Size kUnifiedFeaturePodCollapsedSize(46, 46);
  143. constexpr gfx::Insets kUnifiedFeaturePodHoverPadding(2);
  144. constexpr int kUnifiedFeaturePodVectorIconSize = 18;
  145. constexpr int kUnifiedFeaturePodLabelWidth = 85;
  146. constexpr int kUnifiedFeaturePodSpacing = 6;
  147. constexpr int kUnifiedFeaturePodHoverCornerRadius = 4;
  148. constexpr int kUnifiedFeaturePodVerticalPadding = 24;
  149. constexpr int kUnifiedFeaturePodTopPadding = 20;
  150. constexpr int kUnifiedFeaturePodBottomPadding = 0;
  151. constexpr int kUnifiedFeaturePodHorizontalSidePadding = 12;
  152. constexpr int kUnifiedFeaturePodHorizontalMiddlePadding = 0;
  153. constexpr int kUnifiedFeaturePodCollapsedVerticalPadding = 12;
  154. constexpr int kUnifiedFeaturePodCollapsedHorizontalPadding = 24;
  155. constexpr int kUnifiedFeaturePodLabelLineHeight = 16;
  156. constexpr int kUnifiedFeaturePodLabelMaxLines = 2;
  157. constexpr int kUnifiedFeaturePodSubLabelLineHeight = 15;
  158. constexpr int kUnifiedFeaturePodLabelFontSize = 13;
  159. constexpr int kUnifiedFeaturePodSubLabelFontSize = 12;
  160. constexpr int kUnifiedFeaturePodInterLabelPadding = 2;
  161. constexpr int kUnifiedFeaturePodArrowSpacing = 4;
  162. constexpr int kUnifiedFeaturePodMinimumHorizontalMargin = 4;
  163. constexpr int kUnifiedFeaturePodItemsInRow = 3;
  164. constexpr int kUnifiedFeaturePodMaxRows = 3;
  165. constexpr int kUnifiedFeaturePodMinRows = 1;
  166. constexpr int kUnifiedFeaturePodMaxItemsInCollapsed = 5;
  167. constexpr int kUnifiedFeaturePodsPageSpacing = 48;
  168. constexpr int kUnifiedNotificationSeparatorThickness = 1;
  169. constexpr int kPageIndicatorViewMaxHeight = 20;
  170. // Constants used in system tray page transition animations.
  171. constexpr double kCollapseThreshold = 0.3;
  172. // Separators between multiple users are shorter than the full width.
  173. constexpr int kUnifiedUserChooserSeparatorSideMargin = 64;
  174. // Additional gap above and below the longer separator between user list and
  175. // "Sign in another user..." button.
  176. constexpr int kUnifiedUserChooserLargeSeparatorVerticalSpacing = 8;
  177. constexpr int kUnifiedUserChooserRowHeight = 64;
  178. // Gap between the buttons on the top shortcut row, other than the
  179. // expand/collapse button.
  180. constexpr int kUnifiedTopShortcutButtonDefaultSpacing = 16;
  181. constexpr int kUnifiedTopShortcutButtonMinSpacing = 4;
  182. // Constants used in the detailed view in UnifiedSystemTray.
  183. constexpr auto kUnifiedDetailedViewTitlePadding =
  184. gfx::Insets::TLBR(0, 0, 0, 16);
  185. constexpr int kUnifiedDetailedViewTitleRowHeight = 64;
  186. // Constants used for the status area overflow button and state.
  187. constexpr gfx::Size kStatusAreaOverflowButtonSize(28, 32);
  188. constexpr int kStatusAreaLeftPaddingForOverflow = 100;
  189. constexpr int kStatusAreaForceCollapseAvailableWidth = 200;
  190. constexpr int kStatusAreaOverflowGradientSize = 24;
  191. // Height compensations in tablet mode based on whether the hotseat is shown.
  192. constexpr int kTrayBubbleInsetTabletModeCompensation = 8;
  193. constexpr int kTrayBubbleInsetHotseatCompensation = 16;
  194. // Constants used for the privacy screen toast.
  195. constexpr int kPrivacyScreenToastMinWidth = 256;
  196. constexpr int kPrivacyScreenToastMaxWidth = 512;
  197. constexpr int kPrivacyScreenToastHeight = 64;
  198. constexpr int kPrivacyScreenToastMainLabelFontSize = 14;
  199. constexpr int kPrivacyScreenToastSubLabelFontSize = 13;
  200. constexpr auto kPrivacyScreenToastInsets = gfx::Insets::VH(10, 16);
  201. constexpr int kPrivacyScreenToastSpacing = 16;
  202. // Constants used for media tray.
  203. constexpr int kMediaTrayPadding = 8;
  204. // There is no active user session during oobe, which means it doesn't support
  205. // dark mode. Sets the icon color to be constant.
  206. constexpr SkColor kIconColorInOobe = gfx::kGoogleGrey700;
  207. // Constants used for the autozoom toast.
  208. constexpr int kAutozoomToastMinWidth = 160;
  209. constexpr int kAutozoomToastMaxWidth = 320;
  210. constexpr int kAutozoomToastMainLabelFontSize = 14;
  211. constexpr auto kAutozoomToastInsets = gfx::Insets::VH(10, 16);
  212. constexpr int kAutozoomToastSpacing = 16;
  213. } // namespace ash
  214. #endif // ASH_SYSTEM_TRAY_TRAY_CONSTANTS_H_