split_view_constants.h 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // Copyright 2017 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_WM_SPLITVIEW_SPLIT_VIEW_CONSTANTS_H_
  5. #define ASH_WM_SPLITVIEW_SPLIT_VIEW_CONSTANTS_H_
  6. #include "ash/ash_export.h"
  7. #include "third_party/skia/include/core/SkColor.h"
  8. namespace ash {
  9. // The ratio between a highlight view's primary axis, and the screens
  10. // primary axis.
  11. ASH_EXPORT constexpr float kHighlightScreenPrimaryAxisRatio = 0.10;
  12. // The padding between a highlight view and the edge of the screen.
  13. ASH_EXPORT constexpr float kHighlightScreenEdgePaddingDp = 8;
  14. // The amount of inset to be applied on a split view label. Here horizontal and
  15. // vertical apply to the orientation before rotation (if there is rotation).
  16. constexpr int kSplitviewLabelHorizontalInsetDp = 16;
  17. constexpr int kSplitviewLabelVerticalInsetDp = 8;
  18. // The preferred height of a split view label.
  19. constexpr int kSplitviewLabelPreferredHeightDp = 36;
  20. // The amount of round applied to the corners of a split view label.
  21. constexpr int kSplitviewLabelRoundRectRadiusDp = 18;
  22. // The thickness of the divider when it is not being dragged.
  23. constexpr int kSplitviewDividerShortSideLength = 8;
  24. // The thickness of the divider during dragging.
  25. constexpr int kSplitviewDividerEnlargedShortSideLength = 16;
  26. // The time duration for the window transformation animations.
  27. constexpr auto kSplitviewWindowTransformDuration = base::Milliseconds(250);
  28. // The time duration for the divider animations when dragging starts and ends.
  29. constexpr auto kSplitviewDividerSelectionStatusChangeDuration =
  30. base::Milliseconds(250);
  31. // The time duration for the divider spawning animation.
  32. constexpr auto kSplitviewDividerSpawnDuration = base::Milliseconds(100);
  33. // The delay before the divider spawning animation.
  34. constexpr auto kSplitviewDividerSpawnDelay = base::Milliseconds(183);
  35. // The thickness of the divider's handler.
  36. constexpr int kSplitviewWhiteBarShortSideLength = 2;
  37. // The length of the divider's handler.
  38. constexpr int kSplitviewWhiteBarLongSideLength = 16;
  39. // The corner radius of the divider's handler.
  40. constexpr int kSplitviewWhiteBarCornerRadius = 1;
  41. // The radius of the circular handler when the divider is being dragged.
  42. constexpr int kSplitviewWhiteBarRadius = 4;
  43. // The length of the divider's handler when it spawns.
  44. constexpr int kSplitviewWhiteBarSpawnLongSideLength = 2;
  45. // The distance from the divider to where its handler spawns.
  46. constexpr int kSplitviewWhiteBarSpawnUnsignedOffset = 2;
  47. // The opacity of the drag-to-snap or cannot-snap drag indicator.
  48. constexpr float kHighlightOpacity = 0.3f;
  49. constexpr float kDarkLightHighlightOpacity = 0.4f;
  50. constexpr float kDarkLightHighlightCannotSnapOpacity = 0.2f;
  51. // The opacity of the split view snap preview area.
  52. constexpr float kPreviewAreaHighlightOpacity = 0.18f;
  53. constexpr float kDarkLightPreviewAreaHighlightOpacity = 0.2f;
  54. // In portrait mode split view, if the caret in the bottom window is less than
  55. // `kMinCaretKeyboardDist` dip above the upper bounds of the virtual keyboard,
  56. // then we push up the bottom window above the virtual keyboard to avoid the
  57. // input field being occluded by the virtual keyboard. The upper bounds of the
  58. // bottom window after being pushed up cannot exceeds 1 -
  59. // `kMinDividerPositionRatio` of screen height.
  60. constexpr int kMinCaretKeyboardDist = 16;
  61. constexpr float kMinDividerPositionRatio = 0.15f;
  62. } // namespace ash
  63. #endif // ASH_WM_SPLITVIEW_SPLIT_VIEW_CONSTANTS_H_