Skip to content

Add Mojave-style tabs, which also supports Dark Mode #791

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 3 commits into from
Nov 26, 2018

Conversation

ychin
Copy link
Member

@ychin ychin commented Nov 26, 2018

Add a new tab style "Mojave". The files were copied from Yosemite-style tabs but with additional improvements. It now reads the colors from an asset catalog with colors for both dark and light modes. The colors and style are also retuned to look more like native Mojave tabs. The new tab and close tab buttons are now using a style much more similar to what native macOS are like, with the close tab button showing up when mouse is hovering over a particular tab.

Reason for cloning PSMYosemiteTabStyle is to avoid having too many special cases in a single file and to avoid breaking its behaviors on older systems. Also, PSMTabBarControl is mostly a dead project, so it's wise to modify existing code as little as possible.

MacVim will only use this style if it's compiled with Mojave SDKs and it's actually being run in Mojave (10.14) or higher.

Fix #775

@ychin ychin force-pushed the tabs_dark_mode_and_fixes branch from 3d91f12 to 7982284 Compare November 26, 2018 10:39
Add a new tab style "Mojave". The files were copied from Yosemite-style
tabs but with additional improvements. It now reads the colors from an
asset catalog with colors for both dark and light modes. The colors and
style are also retuned to look more like native Mojave tabs. The new tab
and close tab buttons are now using a style much more similar to what
native macOS are like, with the close tab button showing up when mouse
is hovering over a particular tab.

Reason for cloning PSMYosemiteTabStyle is to avoid having too many
special cases in a single file and to avoid breaking its behaviors on
older systems. Also, PSMTabBarControl is mostly a dead project, so it's
wise to modify existing code as little as possible.

MacVim will only use this style if it's compiled with Mojave SDKs and
it's actually being run in Mojave (10.14) or higher.

Fix macvim-dev#775
@ychin ychin force-pushed the tabs_dark_mode_and_fixes branch from 7982284 to 6e1489e Compare November 26, 2018 11:41
@ychin ychin merged commit bbbdc47 into macvim-dev:master Nov 26, 2018
@ychin ychin deleted the tabs_dark_mode_and_fixes branch November 26, 2018 18:54
@grr
Copy link

grr commented Dec 5, 2018

after upgrading to 8.1.560 on Sierra 10.12.6, which does not have dark mode, my titlebar is now completely black. can't read the title text and it's also not as easy to grab the titlebar to move the window since my colorscheme background color is also black:
screen shot 2018-12-05 at 14 51 01

@ychin
Copy link
Member Author

ychin commented Dec 5, 2018 via email

@grr
Copy link

grr commented Dec 5, 2018

yes, running with -i NONE -u NONE shows a normal (non-dark) titlebar. i wouldn't have expected anything in my vimrc to affect part of the window manager. i'll try to figure out which setting is the root cause.

@grr
Copy link

grr commented Dec 5, 2018

ok, running again with -i NONE -u NONE, then :set nocompatible, then choose any colorscheme, and the titlebar becomes the background color, so it's not just binary setting of normal/dark titlebar. using the "blue" colorscheme will result in a blue titlebar:
screen shot 2018-12-05 at 17 23 37

@ychin
Copy link
Member Author

ychin commented Dec 6, 2018

Thanks for the info. I think I know where the problem is but I would need to find a way to test this first.

Filed #799 to help track this since this is a separate issue from dark mode tabs. Please leave further comments there.

@mfn
Copy link

mfn commented Dec 6, 2018

Just received the auto update on Mac, with dark mode support. Wow!

Thanks, it's the small details ;-) 🙇‍♂️

@kkkrist
Copy link

kkkrist commented Dec 8, 2018

Yes, it's great! Just wondering: Is there a way to manually turn it on? I'd prefer to just use MacVim with dark mode and keep the rest of the system "light".

@peterrenshaw
Copy link

Titlebar requires contrasting text colour. Usable but PIA. (OS X El Capitan 10.11.X)

@ychin
Copy link
Member Author

ychin commented Dec 8, 2018

Just wondering: Is there a way to manually turn it on? I'd prefer to just use MacVim with dark mode and keep the rest of the system "light".

@kkkrist Sorry but I would have to say probably not for now. MacVim currently supports a fair amount of options, and preferences like this is actually the source of a fair amount of bugs since it makes it harder to code and test. The colors are also toggled directly by dark mode so it would involve some work to refactor. If you use "light mode" for the OS the window frame will appear light anyway so it won't be completely dark.

Feel free to file an issue for tracking though.

@kkkrist
Copy link

kkkrist commented Dec 8, 2018

@kkkrist Sorry but I would have to say probably not for now. MacVim currently supports a fair amount of options, and preferences like this is actually the source of a fair amount of bugs since it makes it harder to code and test. The colors are also toggled directly by dark mode so it would involve some work to refactor. If you use "light mode" for the OS the window frame will appear light anyway so it won't be completely dark.

Feel free to file an issue for tracking though.

Thanks for your answer! I had just hoped there is some setting or call being triggered when you set your desktop to dark mode that's also accessible to users.

It's just that I prefer dark themes and I've become a bit spoilt by iTerm which can be set to display a dark window frame and dark tabs independently from the macOS desktop settings.

But it's really not that important or even worth an issue.

I have a lot of respect for what you do, the work on MacVim is very much appreciated!

@genivia-inc
Copy link

I'm having the exact same issue as @grr with version 8.1.560 on Mac OS 10.12.6: my title bar has the background color (dark blue color DarkBlue in .vimrc) with black title text, which makes it impossible to read. Any suggestions on how to change my .vimrc are appreciated!

@ychin
Copy link
Member Author

ychin commented Dec 9, 2018

@genivia-inc Use a different colorscheme for now. There is a PR on this and there will be a release to fix this soon (https://github.com/macvim-dev/macvim/milestone/1).

Also please use #799 for tracking this. This bug is not due to dark tabs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tabs do not pick dark theme on Mojave
6 participants