Skip to content
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

Support for macOS 10.14 dark mode #276

Open
singularitti opened this issue Sep 27, 2018 · 15 comments
Open

Support for macOS 10.14 dark mode #276

singularitti opened this issue Sep 27, 2018 · 15 comments

Comments

@singularitti
Copy link

singularitti commented Sep 27, 2018

Will you consider support the macOS 10.14 Mojave's dark mode?
Expected features:

  1. Dark title bar: just as what they do for Terminal.app:
    titlebar
  2. Allow user to choose from dark and light titlebars
  3. Dynamic title bar: The titlebar's color will change from light to dark when the sun is set (This feature may be too much so I do not really expect it to be implemented now)
@cmyr
Copy link
Member

cmyr commented Sep 28, 2018

yep, definitely would be nice to do, good to have an issue for this.

@singularitti
Copy link
Author

singularitti commented Sep 28, 2018

Great! Thanks! I think we should also allow to change the color of the left sidebar(line numbers)? I forgot to mention it in the top.

@singularitti
Copy link
Author

For the third request, maybe we can let xi to detect the system theme and change according to it? I do not know how it is implemented but in some apps they could follow the system's theme.

@jansol
Copy link
Contributor

jansol commented Sep 28, 2018

One thing I'd like to see that's kind of related to this is adopting translucent VisualEffectView + vibrancy (as demonstrated at WWDC) on all the things. (I love using vim in a translucent terminal.)

As for automatically changing between light and dark... xi-mac could allow that iff the current colorscheme has both a light and a dark version.

EDIT: the WWDC video I linked actually mentions how to make your application switch between light and dark mode automatically.

@habovh
Copy link

habovh commented Oct 2, 2018

AFAIK and according to the docs if the app uses semantic colors from NSColor, the dark mode support and the transition would be automatically handled by the system.

So I guess what could be nice, is have a theme that uses exclusively semantic colors from NSColor. This would —I guess— provide a light/dark theme based on macOS's settings.

EDIT: Funny enough, if you close the first window that opens after the app launch (CMD + W), and reopen a new one, the second one adapts to the light/dark setting!

xieditor-1-gif

@singularitti
Copy link
Author

EDIT: Funny enough, if you close the first window that opens after the app launch (CMD + W), and reopen a new one, the second one adapts to the light/dark setting!

I found it too, and I do not like this inconsistency.

@jansol
Copy link
Contributor

jansol commented Oct 2, 2018

There was a mention about having to use a property instead of setting the color manually in the WWDC video. Setting it manually would mean having to update it manually, whereas the property is supposed to propagete updates from the system automagically.

@habovh
Copy link

habovh commented Oct 2, 2018

If you comment out these lines, the title bar follows the system theme on first opening window as well. I'm not sure what these lines are here for though, so it definitely needs a more insightful research.

@jansol I think (correct me if I'm wrong) themes are loaded from core and are read as rgba colors from a JSON-like object. This would require a "special" theme that does not rely on core, and that uses NSColor semantic colors directly. Shouldn't the NSColor semantic colors used manually automagically update as well?

@singularitti
Copy link
Author

It would be better if we could have the sidebar to be dark also. It is kind of inconsistent in current build:
image

@singularitti
Copy link
Author

singularitti commented Oct 2, 2018

Just a comment, only commenting out those lines will result in a weird searchbar:
image

@habovh
Copy link

habovh commented Oct 2, 2018

@singularitti yes, there's definitely more to it than just a few lines to change...

I've managed to add a macOS entry in the Debug → Theme menu, but my approach is rather sloppy.
If I can get something that kind of works as a proof of concept, I might open a PR. Here's a preview.
capture d ecran 2018-10-03 a 00 09 52

@singularitti
Copy link
Author

It looks pretty good to me! @habovh

@habovh
Copy link

habovh commented Oct 3, 2018

@singularitti It might look good on a screenshot, but I don't believe the code stands for the high-quality standard that xi-editor is aiming at. This is my first time tinkering with Swift, and like I said, xi-mac has a strong dependency on xi-core, even for the theme appearance. I'll have to dig deeper into this.

@jansol
Copy link
Contributor

jansol commented Oct 3, 2018

My main concern is how that interacts with syntax themes. The vibrance blending mode will probably make that magically Just Work, but it'll need some experimenting.

Don't worry about code quality for now, sorting out that is part of the reason why PR reviews exist. WIP/RFC pull requests also have a place, and this sort of thing is exactly that place.

And last but not least, we make a point of not biting in reviews 😉.

@nangtrongvuon
Copy link
Member

@habovh You can make a PR, and I'll make sure to give it a look :)

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

No branches or pull requests

6 participants
@jansol @cmyr @habovh @nangtrongvuon @singularitti and others