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

MMTabline: Add Vim colorscheme / window use tab fill color support #1539

Conversation

ychin
Copy link
Member

@ychin ychin commented Feb 1, 2025

Tabs can now use colors defined by the Vim colorscheme under the TabLine/TabLineFill/TabLineSel highlight groups. There are now 3 coloring modes available: default, automatic (the default mode that generates matching colors using foreground/background colors), and Vim colorscheme. The new mode looks quite nice in some colorschemes and allows user customization, but for some existing ones it doesn't quite look right as they were designed for non-GUI tabs, which is why it's not the default.

MacVim window can now also use the tabline's fill color as the window background color, which allows the title bar to show as a cohesive whole when transparent title bar is set. This creates a nice look especially when the colorscheme is designed for this.

Other tab coloring changes:

  • Tabs now support high contrast mode (macOS accessibility setting) now. The default colors will use higher contrast colors, and in all modes, the tabs will be drawn with an outline similar to other system native UI to aid visual differentiation.
  • Tabs will also show a dimmed text color when the window has lost focus, similar to other native title bar / tool bar UI elements.
  • Fixed default colors to look a little better. Previously the fill color and unselected tab background colors were the same.

@ychin ychin added the UI Issues related to UI elements, tabs, scrollbars, window resizing, etc. label Feb 1, 2025
@ychin ychin added this to the Release 181 milestone Feb 1, 2025
@ychin
Copy link
Member Author

ychin commented Feb 1, 2025

Just some visual references for what tabs look like below.

Also, see #1120 for original tabs implementation and also discussion about "transparent title bar" and how it would be nice to pick the Vim colorscheme values and whatnot.

Default colors

I changed the colors a bit. In the original implementation the fill color and unselected tab background colors were the same, so there were no visual borders. I changed it so the fill colors are lighter now and you do see a border of the unselected tabs relative to the background. I'm a little undecided which style looks better as it's a tradeoff between visual clarity vs minimalist look. I decided to go with the differentiated look to make the style more consistent with auto colors (in the Vim colorscheme mode though it's pretty much up to each colorscheme what they want to do).

Light (old):
image
Dark (old):
image

Light:
image
Dark:
image
Light high-contrast (✨NEW✨):
image
Dark high-contrast (✨NEW✨):
image

Automatic colors

This is what we had before. Transparent title bar is set in the screenshots. And also shown is whether we have the ✨ NEW✨ "Window: use tabs background color" option off/on for comparison:

Color: desert:
image
image

Color: darkblue:
image
image

Color: retrobox (light/dark):
image
image
image
image

Third-party colorschemes:

Color: solarized (light/dark):
image
image
image
image

Color: iceberg (light/dark):
image
image
image
image

Vim colorscheme colors (✨NEW✨ )

This is the new feature that now respects the TabLine/etc highlight groups. Note that some colorschemes look kind of odd (desert) whereas some other ones (iceberg) look very well integrated, intentional and nice; and some (darkblue) just looks kind of mediocre. This is why it's better to just have Automatic Colors as default and the motivated user can set to use Vim colorscheme if they know their colorscheme works well or they are willing to tweak the highlight values.

All the screenshots have "Window: use tabs background color" (✨NEW✨) set to be ON for simplicity's sake.

Color: desert
image

Color: darkblue
image

Color: retrobox (light/dark)
image
image

Third-party colorschemes:

Color: solarized (light/dark):
image
image

Color: iceberg (light/dark):
image
image

High-contrast outlines work in auto / Vim colorscheme modes too. Below is solarized (dark) in high-contrast mode:

image

@ychin ychin mentioned this pull request Feb 1, 2025
Tabs can now use colors defined by the Vim colorscheme under the
TabLine/TabLineFill/TabLineSel highlight groups. There are now 3
coloring modes available: default, automatic (the default mode that
generates matching colors using foreground/background colors), and Vim
colorscheme. The new mode looks quite nice in some colorschemes and
allows user customization, but for some existing ones it doesn't quite
look right as they were designed for non-GUI tabs, which is why it's not
the default.

MacVim window can now also use the tabline's fill color as the window
background color, which allows the title bar to show as a cohesive whole
when transparent title bar is set. This creates a nice look especially
when the colorscheme is designed for this.

Other tab coloring changes:
- Tabs now support high contrast mode (macOS accessibility setting) now.
  The default colors will use higher contrast colors, and in all modes,
  the tabs will be drawn with an outline similar to other system native
  UI to aid visual differentiation.
- Tabs will also show a dimmed text color when the window has lost
  focus, similar to other native title bar / tool bar UI elements.
- Fixed default colors to look a little better. Previously the fill
  color and unselected tab background colors were the same.
@ychin ychin force-pushed the mmtabs-option-colorscheme-use-tab-color-window branch from 82ec6d0 to 663fba9 Compare February 1, 2025 02:56
@ychin ychin merged commit ed41976 into macvim-dev:master Feb 1, 2025
4 checks passed
@ychin ychin deleted the mmtabs-option-colorscheme-use-tab-color-window branch February 1, 2025 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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