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

How about adding an option for changing the titlebar's color? #266

Closed
chuanconggao opened this issue Apr 21, 2016 · 18 comments · Fixed by #1038
Closed

How about adding an option for changing the titlebar's color? #266

chuanconggao opened this issue Apr 21, 2016 · 18 comments · Fixed by #1038
Labels
Feature Request New features request. Not an existing issue or bug.

Comments

@chuanconggao
Copy link

chuanconggao commented Apr 21, 2016

It would be great if a MacVim specific option can be added to control the titlebar's color. I know that many Mac app already have fancy customized titlebar colors, like Word or Excel. Adding this function could help improve the look-and-feel greatly with matching color themes, especially when using OS X's dark mode.

This repo already provides very mature code for doing this.

@jpetrie
Copy link
Contributor

jpetrie commented Apr 21, 2016

I'm not particularly enthusiastic about the idea, personally (I feel like it falls into the category of "just because we can doesn't mean we should"), but I wouldn't necessarily refuse a well-implemented PR for it. How do you expect this to look, interface-wise (as in, how does one manipulate this color and what special behavior does it have)? Are there separate settings for light and dark mode?

Is MacVim's window not respecting dark mode toggles as-is? That, at least, seems like it would be a bug we should address.

@chuanconggao
Copy link
Author

chuanconggao commented Apr 23, 2016

I think maybe just a simple option like set titlebarcolor=#1C1C1C. Of course, the tab bar underneath the title bar also needs the same background color (maybe with a different transparency).

I do not think we need to consider too much about dark mode toggle right now. Usually the title bar color would be chosen to match the color theme, rather than dark mode or not.

@jpetrie
Copy link
Contributor

jpetrie commented Apr 23, 2016

A new set option is something that would generally need to be added by core vim, not MacVim itself. That's why most of the MacVim-specific options we have (which fullscreen mode to use, ligature support, et cetera) are implemented as actual preference items in the MacVim GUI (generally via NSUserDefaults).

Modifying core vim's code, where all the set options are handled, seems to me like it would significantly increase the cost of merging in core vim's changes. I don't think that cost is worth paying for a feature like this. Perhaps @splhack can weigh in on what kind of impact that would have on our merge process, but my understanding is that it would be an annoyance.

@splhack splhack added the Feature Request New features request. Not an existing issue or bug. label May 10, 2016
@wayneashleyberry
Copy link

wayneashleyberry commented Sep 23, 2016

I'd also love this, it is minor but really does make the window look modern.

Atom just shipped this in 1.11 beta and they had a great discussion about it over on atom/atom#11790.

@lauevrar77
Copy link

lauevrar77 commented Dec 21, 2017

An idea if this will be implemented sooner or later ?

@mvanier
Copy link

mvanier commented Jan 1, 2018

I'd love this too. I use a dark theme and also use iterm2 with a dark title bar and a dark background, and the light title bar on MacVim is a bit distracting.

@christopher-francisco
Copy link

So do I. I mostly use Vim for writing, but for reading I rather macvim; would be cool I could also have colored title bar here

@robinmitra
Copy link

I'm also interested in this feature as the titlebar is quite distracting when coding in the night with a dark theme.

I'm willing to help develop this functionality but would appreciate if someone can give me a few pointers to get started on the right track?

@jpetrie
Copy link
Contributor

jpetrie commented Apr 18, 2018

@robinmitra I've never gone about customizing the color of an NSWindow title bar, so I can't offer much guidance there other than to suggest plugging "custom NSWindow title bar" into a search engine. There's a few potentially promising hits on StackOverflow, such as this one.

In MacVim itself, MMWindow is a NSWindow subclass used by MacVim and would probably be a good place to start looking at how to handle the custom setup and drawing.

If you want to plug this into MacVim's preferences and GUI, this commit had some changes that added a new preference key and hooked it up, so you could wire the setting up that way.

I'm not sure of the best way to integrate the setting if you wanted to implement as a regular vim set option. This pending PR does something similar (in that it involves touching core vim source to add some options) but I'm not sure how helpful it would be as a guideline.

However you implement it, it should be possible to disable it (so users who want the window to look like a regular OS window don't have to guess at a "good color" to get that effect) and should not be enabled by default.

@chdiza
Copy link
Contributor

chdiza commented Apr 18, 2018

This should definitely not be a regular vim option, but should instead be something to set with defaults write (or the Preferences window).

@robinmitra
Copy link

Thanks, that gives me a good starting point. I'll come back with any questions.

@statico
Copy link

statico commented Aug 10, 2018

Here are some more resources:

A strong +1 to this, too. It might also satisfy the people having issues in #111 as well.

@ychin
Copy link
Member

ychin commented Nov 27, 2018

#791 added "Mojave-style" tabs, where the colors and theming look similar to how native macOS tabs do (dirty detail: it's not the same as native tabs, because macOS doesn't expose a native tabs UI control for developers). This should make the tabs more pleasant to deal with as they would look similar to other native Apple apps and if you toggle dark mode, the tabs would turn to a dark gray color as well so it won't be blinding to you. It's only going to be active if you are running MacVim on Mojave or above.

I think this is probably the best move forward as it works out of the box and looks similar to other native Mac apps (the main goal of MacVim is to provide the Vim experience in an app that feels like a native macOS Cocoa app). Adding customization like this proposal always comes with a maintenance cost moving forward so I'm a little hesitant to add this feature.

Leaving the issue open for now to see if there are any further discussions on this.

@ychin
Copy link
Member

ychin commented Apr 28, 2019

#888 is adding option to make titlebar transparent so the colorscheme background will be visible instead. Not a full substitution for what's being asked here, but should work for some people I hope.

@nabsiddiqui
Copy link

How exactly do I set this @ychin ?

@eirnym
Copy link
Contributor

eirnym commented Jun 14, 2019

@nabsiddiqui As per documentation, you write defaults variable in terminal. (:help macvim-user-defaults)

defaults write org.vim.MacVim MMTitlebarAppearsTransparent true

@nabsiddiqui
Copy link

Ah. Thank you. BTW, it looks awesome now.

@ychin
Copy link
Member

ychin commented Jun 17, 2019

I filed #912 to consider adding this option (and maybe a few other non-niche settings) in the Preferences UI so you don't need terminal to set it.

ychin added a commit to ychin/macvim that referenced this issue Apr 13, 2020

Verified

This commit was signed with the committer’s verified signature.
ychin Yee Cheng Chin
Add new preference that allows specifying how MacVim will use dark mode:
use systems preference (default), force light mode, force dark mode, or
use Vim's 'background' option to decide. Preference will be stored in
defaults as 'MMAppearanceModeSelection'. Add docs for that as well.

Also, add a new preferences panel called "Appearance" to allow setting
the dark mode setting, and transparent titlebar as well. Setting it will
refresh all Vim windows immediately for feedback.

Also, when setting titlebars to transparent, also hide the file icon as
it's distracting in what's a more minimalistic display. Don't use
another preference for that for now to avoid having too many options.

Minor: Remove preference panel's cross-fade effect as it's more
distracting than useful.

Fix macvim-dev#912

Also:
- See macvim-dev#1015 for part of the contribution.
- Close macvim-dev#266
- Close macvim-dev#933
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request New features request. Not an existing issue or bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.