Skip to content

Add option to enable a transparent titlebar #884 #888

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
Apr 28, 2019

Conversation

thoradam
Copy link
Contributor

Adds an option MMTitlebarAppearsTransparent that makes the titlebar appear transparent.

Screenshot 2019-04-27 at 22 05 27

Screenshot 2019-04-27 at 22 05 47

One thing to consider is that the text colour in the titlebar is decided by the system appearance setting, so if you use a dark theme in vim and have the system appearance set to Light the titlebar text will be hard to see. I'm assuming people using this setting will recognise that.

@thoradam thoradam force-pushed the transparent-titlebar branch from 919f676 to 9731c2a Compare April 27, 2019 20:20
@ychin
Copy link
Member

ychin commented Apr 28, 2019

This looks good. I'll merge it. Thanks.

One thing to point out is that this only works as expected on Mojave (10.14), not earlier macOS versions. It's not really this PR's fault, but rather because of some weird interactions with our window styling which turned off setting window background color in 10.13 or below (#805). Ironically that was to fix #799 which had to do with titlebar turning transparent in earlier macOS versions. Probably ok for now for an optional feature instead of trying to fix it. macOS 10.15 will be coming out soon as well.

Also, tabs look weird as they are custom drawn using PSMTabBarControl. Don't think there's a good solution for this unless we implement custom styling for tabs.

Also, for cross referencing, #266 asked for custom colors for titlebars, but this could work as a substitute for some people.

One thing to consider is that the text colour in the titlebar is decided by the system appearance setting, so if you use a dark theme in vim and have the system appearance set to Light the titlebar text will be hard to see. I'm assuming people using this setting will recognise that.

I agree this is an acceptable compromise. It's ideal if we could use the colorscheme's foreground color as titlebar color but I don't think it's worth it to try to do that now.

@ychin ychin merged commit e06ff0d into macvim-dev:master Apr 28, 2019
@ychin ychin mentioned this pull request Apr 28, 2019
@ychin ychin added this to the snapshot-156 milestone Jun 11, 2019
ychin added a commit to ychin/macvim that referenced this pull request Jun 11, 2019
Vim patch 8.1.1517

Security Fixes:

- Fix modeline security vulnerability (CVE-2019-12735). macvim-dev#898 (fixed in
  Vim 8.1.265)

Features:

- Add new option 'MMTitlebarAppearsTransparent' that will make the title
  bar transparent and use the background color in the color scheme
  (10.14 or above only). macvim-dev#888

Fixes:

- Fix filename parsing error when opening a file with special characters
  like '$' in file path. macvim-dev#863
- Fix blurry I-beam mouse cursor. macvim-dev#755
- Fix silently failing to save a file when conversion error is present.
  macvim-dev#671. (Vim 8.1.1349)
- Fix failing to save to a network shared SMB folder macvim-dev#861.
  (Vim 8.1.0957)

Misc:

- 'guitablabel' can now be set in .vimrc, without MacVim overriding it.
  macvim-dev#899

Targets macOS 10.8+

Script interfaces have compatibility with these versions:

- Lua 5.3
- Perl 5.18
- Python2 2.7
- Python3 3.7
- Ruby 2.6
@xaviervalarino
Copy link

Is MMTitlebarAppearsTransparent only on Mojave? setting it with defaults doesn't seem to do anything on High Sierra.

@ychin
Copy link
Member

ychin commented Jun 21, 2019

@xaviervalarino Yes it is only available Mojave or above. I commented on it in a previous comment (#888 (comment)) but the docs doesn't make that explicit. I will update to make it clear.

As for why and whether it will be back-ported to High Sierra, currently the Mojave rendering / window setup path is a little different from High Sierra, and it would require a little bit of code refactoring to make this work in High Sierra. It's unfortunate but since it's a new feature I didn't think it's worth the effort to port the new feature to work on High Sierra.

@ychin
Copy link
Member

ychin commented Jun 21, 2019

Actually, seems like it's pretty easy to make it work for High Sierra. I will do that in a new pull request.

ychin added a commit to ychin/macvim that referenced this pull request Jun 21, 2019
Added the special path to make tranparent titlebars work on pre-Mojave
builds as well. It's annoying we have to two maintain separate code
paths for how windows / titlebars work but this wasn't too hard to add.
We just need to make sure to to set the background color on the window
*only* when we have transparent titlebar set. Otherwise we don't want to
do it because of weird interactions with textured window flag.

This addresses comments made in macvim-dev#888.
@TakaKeiji
Copy link

macOS Mojave 10.14.6

With MMTitlebarAppearsTransparent enabled and...
set transparency=0, I have this:
image

set transparency=(anything higher than 0) I get this...
image

Any idea how to get the transparency effect applied to the title bar?

@edouardp
Copy link

edouardp commented Aug 23, 2020

macOS Mojave 10.14.6

With MMTitlebarAppearsTransparent enabled and...
set transparency=0, I have this:
image

set transparency=(anything higher than 0) I get this...
image

Any idea how to get the transparency effect applied to the title bar?

I have the same issue on Catalina 10.15.6 - works perfectly if I see my transparency=0, but not for any non-zero value of transparency .

It would be great if the titlebar can follow the same transparency and blurradius settings for the body of the window.

Should we open a new issue for this?

@ychin
Copy link
Member

ychin commented Aug 24, 2020

Yes please open a new issue. This PR is closed and I won't really look at this much in the future.

I can repro this problem, but I think it could be low on priority and therefore may not be fixed in the next release.

@edouardp
Copy link

Bug raised: #1081

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

Successfully merging this pull request may close these issues.

5 participants