overlay-scrollbar-opacity.patch 899 B

1234567891011121314151617181920
  1. ## This patch sets a minimum opacity for scrollbars.
  2. #
  3. # I use the OverlayScrollbar feature flag, and enjoy the aesthetic except for
  4. # the fact that the scrollbar disappears completely. Being able to see the bar
  5. # slightly helps to visulize your position on the page as well as letting you
  6. # know where to move your mouse should you go reaching for it.
  7. #
  8. # I use 0.15 here, but you can adjust that to your liking.
  9. --- a/cc/input/scrollbar_animation_controller.cc
  10. +++ b/cc/input/scrollbar_animation_controller.cc
  11. @@ -364,6 +364,8 @@ void ScrollbarAnimationController::Show(
  12. }
  13. void ScrollbarAnimationController::ApplyOpacityToScrollbars(float opacity) {
  14. + if (opacity < 0.15f)
  15. + opacity = 0.15f;
  16. for (ScrollbarLayerImplBase* scrollbar : Scrollbars()) {
  17. DCHECK(scrollbar->is_overlay_scrollbar());
  18. float effective_opacity = scrollbar->CanScrollOrientation() ? opacity : 0;