Skip to content

Fix scrollbars in Mojave dark mode not rendering properly #793

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 2, 2018

Conversation

ychin
Copy link
Member

@ychin ychin commented Dec 2, 2018

Dark mode scrollbars's background are rendered in a translucent color so that it would overlay on top of the background nearly, even though we are using legacy scrollbars with a dedicated space. This is unlike light mode scrollbars which render with a concrete color. This means if the background has uncleared rendering it would result in some oddities. Just fix it by making sure we first render the scroll track with the current background color before drawing the system overlay.

Known issues:

  • The scroll knob will look quite light and hard to see if the background color is bright. Consider this OK for now as users who use dark mode will likely have a dark-ish background color in Vim.
  • If both vertical and horizontal scrollbars are enabled, the corners will look black or sometimes filled with rendering artifacts. Will fix this later. One way to fix is to always fill the Vim view with a background color but that seems to slow things down a little bit because setNeedsDisplay seems to be called too much without a rect, so need to fix that first.
  • Vertical scrollbars' positions are sometimes set incorrectly. That's a separate bug and will be addressed later.
  • MacVim currently doesn't support overlay scrollbars which have been introduced in macOS since 10.7. Investigate that option too.

Dark mode scrollbars's background are rendered in a translucent color so
that it would overlay on top of the background nearly, even though we
are using legacy scrollbars with a dedicated space. This is unlike light
mode scrollbars which render with a concrete color. This means if the
background has uncleared rendering it would result in some oddities.
Just fix it by making sure we first render the scroll track with the
current background color before drawing the system overlay.

Known issues:
- The scroll knob will look quite light and hard to see if the
  background color is bright. Consider this OK for now as users who use
  dark mode will likely have a dark-ish background color in Vim.
- If both vertical and horizontal scrollbars are enabled, the corners
  will look black or sometimes filled with rendering artifacts. Will fix
  this later. One way to fix is to always fill the Vim view with a
  background color but that seems to slow things down a little bit
  because setNeedsDisplay seems to be called too much without a rect, so
  need to fix that first.
- Vertical scrollbars' positions are sometimes set incorrectly. That's a
  separate bug and will be addressed later.
- MacVim currently doesn't support overlay scrollbars which have been
  introduced in macOS since 10.7. Investigate that option too.
@ychin ychin force-pushed the scrollbar_dark_mode_fix branch from e732895 to 4ba02a8 Compare December 2, 2018 01:31
@ychin ychin merged commit 63dbd58 into macvim-dev:master Dec 2, 2018
@ychin ychin deleted the scrollbar_dark_mode_fix branch December 2, 2018 23:26
@ychin ychin added the UI Issues related to UI elements, tabs, scrollbars, window resizing, etc. label Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.14 Mojave UI Issues related to UI elements, tabs, scrollbars, window resizing, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant