Sublime Forum

Adaptive UI Theme overlaps native Mac Tabs in build 3192

#1

I am in love with this concept and it works well in the default theme, but I think the adaptive theme needs to be updated for it. The project tabs overlap the rendering of the file tabs.

Default, looks good

Adaptive, overlapping elements

2 Likes

#2

What is the difference between system and preferred for this new preference? Is there a toggle somewhere in macOS System Preferences for tabs? I’m not aware of that.

// Mac only. Controls use of macOS tabs in 10.12 and newer. Each native tab
// contains an entire project, thus allowing multiple projects in a single
// window. Valid values are "system", "preferred" and "disabled".
"native_tabs": "system",
0 Likes

#3

It might be part of this setting? (System Preferences > Dock)

although I’m not entirely sure how that would map…

1 Like

#4

The Adaptive theme uses a full size content view to draw the title bar, and normally Apple disables native tabs when using that mode, however I believe if you’ve created the tabs and then switch to Adaptive you can run into this. We may just need to disable using themes with themed title bars when native tabs are used. We have to do a whole bunch of tricks to get the title bar to render “normally” when using a themed title bar. I don’t think it will be reasonable to try and pull the same thing off with native tabs.

To give you an idea of what we have to do, we have to navigate the control hierarchy to try and find the window text, and then hide it, recreating a new text element at the same position, with the same font and size. As the window is changed the icon in the title bar is changed and sometimes hidden, repositioning the text. The text changes as files are opened and when the window is resized, along with switches to fullscreen. Trying to perfectly recreate the native tabs with their text and focus highlights and stuff would probably be a giant time sink, and could break whenever Apple tweaks the window decorations.

Thus, I think we’ll likely just need to lock out native tabs with themed title bars.

Yes, go to System Preferences > Dock > Prefer tabs when opening documents.

When the setting is system, we use the value of the dropdown from the Dock settings. When preferred, we try to always open new windows as a native tab. When disabled, we only use a native tab when you use the Windows > New Tab menu item. Otherwise new windows in fullscreen go to a separate space, overriding the system setting of “In Full Screen Only.”

4 Likes

#5

That makes sense on a technical level.

Honestly, I was puzzled at first why my “default theme” screenshot had a dark titlebar and tab bar, until I realized that I’ve been using the Adaptive theme for so long that I never noticed the default theme’s transition to Dark Mode Mac title bars in Mojave.


I also noticed that the standard “Window > Merge all Windows” doesn’t work at this time with this feature.

Appears to me to have the same effect, regardless of what UI theme I start in, switch to, or what my SysPref > Dock > Tabs setting is.

:frowning2:

Ditto.

I’d prefer overriding themed title bars w/ native actually. I’d rather not be punished for wanting a stock, dark file listing, or the burden of maintaining my own modified copy of your theme (which I’ve tried and given up on, since you’ve added features and tweaks I’d rather stay up to date on).

Is there a way to use a given theme, but override only certain components or style elements? Like an “import” or “include” statement?

Or to make the new macOS Tab behavior a ST preference setting?

  • Tabs enable = OS titlebar and tabs
  • Tabs disable = pretty themed title bar and no tabs
0 Likes

#6

Will this macOS tab feature get a subl command line option flag?

i.e. “Open in new tab”

0 Likes

#7

If you have a theme file in your User package with the same name as an existing theme, the rules in that file apply on top of the original theme, but everything you haven’t modified remains as it was before.

For example, if you use the Adaptive theme, putting the file from this gist in your user package changes how the status badges in the sidebar work (and their colors) so that the file names take on the colors as well, but everything else about the theme remains the same as stock.

1 Like

#8

So how would someone remove an element that was set by the original, such as remove the “themed titlebar” or un-set a keybinding for example?

0 Likes

#9

https://www.sublimetext.com/docs/3/dev/themes.html#customization

You can set the title_bar class to have a bg with 0 opacity. https://www.sublimetext.com/docs/3/dev/themes.html#elements-windows

{
    "rules": [
        {
            "class": "title_bar",
            "bg": "rgba(0, 0, 0, 0)"
        }
    ]
}
2 Likes

#10

mind blown gif

Thank you, this is SO AMAZING. :sparkling_heart:

0 Likes

#11

@wbond Couple of questions. Is it possible to hide the file icon in the themed title bar. For me it looks like an eyesore:

Second. When I try to set a darker fg color for the text I get this

This is on High Sierra. I know it rendered properly on Sierra and seems to be ok on Mojave (can’t check for myself). Is it really the way High Sierra renders that text? Maybe you know how to handle it

0 Likes

#12

No, the proxy icon is not configurable at the moment.

I know that Apple needs a background to alias against. In my experience Apple if given a low contrast background and foreground will change the background to produce more contrast.

0 Likes

#13

As of build 3193 we automatically disable themed title bars once native tabs are shown, and restore them for windows that no longer have native tabs.

2 Likes

#14

I don’t really understand what is supposed to work and what not but I’m seeing really broken results when testing native tabs here. With "native_tabs": "preferred", native tabs show up when I open two projects (from Project Manager plugin), but native tabs overlap normal file tabs (I can see tiny bit of normal file tabs) and at the same time clicks go through to file tabs when clicking on native tabs. It’s a bit of a mess if you ask me.

0 Likes

#15

Are you on build 3193?

0 Likes

#16

Yes.

I get something like that:

But it’s not always broken. I can see the bug on mac’s retina screen but it goes away if I resize ST window. Also doesn’t seem to happen on external QHD screen.

EDIT: Actually, it happens on external screen too.

The bug seems to trigger when:

  1. ST window is extended all the way to the top of the screen.
  2. Has only one project open (no native tabs shown)
  3. New project is opened (native tabs are created)
0 Likes

#17

Based on this I think you’ve identified a bug in the transition from themed title bar to the default title bar. We’ll get that fixed for the next build.

1 Like

#18

I am still occasionally getting this bug on build 4126. Sorry I can’t describe when and how it happens, I’ll swipe over to my Sublime fullscreen and suddenly it’ll be rendering incorrectly.

My current workaround is for each tab ‘Move Tab to New Window’ then ‘Merge All Windows’.

0 Likes