1

I updated my sublime text 3 to version 4 and in there article, they said that:

The Adaptive theme on Windows and Linux now features custom title bars.

But i can't figure out how to use it. I tried adding this settings:

"ui_native_titlebar": true,
"themed_title_bar": true,

But no luck there. And i am using the ayu theme. Here's how it looks right now:

sublime on my computer

Please anyone can help me that would be great!

Also i am on Linux mint. Have a great day!

Blaze_droid
  • 479
  • 4
  • 13

1 Answers1

1

This is outlined in the comment on the preference:

    // Adaptive theme only: controls if a custom or default title bar is used.
    // Note that on Windows, the hamburger menu is used whenever this is
    // enabled and the adaptive theme is in use.
    "themed_title_bar": true,

The key part being that this is only supported by default in the Adaptive theme.

In order for the title bar to be themed, the theme itself needs to provide a theme rule that does it, and (ideally) that theme rule would be tied to the setting here.

In order to get themed title bar in other themes, you would need to either ask the author of the theme to support it, or create a customization.

Selecting UI: Customize Theme from the command palette will open a window similar to the settings window that allows you to add rules to your current theme.

Something like this would add support for the setting; you may need to adjust the colors to something that matches better. Also, if the right hand pane already has other customizations by you, just copy the rule into the appropriate part of the file instead.

// Documentation at https://www.sublimetext.com/docs/themes.html
{
    "variables":
    {
    },
    "rules":
    [
        {
            "class": "title_bar",
            "settings": ["themed_title_bar"],
            "fg": "color(white)",
            "bg": "color(var(--background) blend(white 85%))",
        },
    ]
}

[edit]

themed_title_bar only works on Windows and MacOS; under Linux it doesn't do anything because it's the job of the window manager theme to customize the window decorations.

On Linux there is a different option for this, gtk_client_side_window_decorations which controls whether client side window decorations are enabled or not. The default value for this is true if you're using gnome and false otherwise.

You can set it explicitly in your user preferences to turn it on or off (a restart of Sublime Text is required).

For more details, see Sublime Text 4 hide title bar.

OdatNurd
  • 21,371
  • 3
  • 50
  • 68
  • Idk why this is not working, Is it something that i am on linux mint. I am losing my mind. – Blaze_droid Jun 27 '21 at 11:35
  • Thanks i worked i just added the rules you tell and the `gtk_client_side_window_decorations` set it to true and it worked, Thanks see my own answer to see how cool it looks now – Blaze_droid Jun 29 '21 at 02:34
  • Hi @OdatNurd we already discussed a few times around ST questions :) As probably the top user for ST on SO, would you have an idea for https://stackoverflow.com/questions/68175111/comparing-the-contents-of-two-files-in-sublime-text-with-a-side-by-side-view? – Basj Jun 29 '21 at 11:44