1

我将我的 sublime text 3 更新到了版本 4,在文章中,他们说:

Windows 和 Linux 上的自适应主题现在具有自定义标题栏。

但我不知道如何使用它。我尝试添加此设置:

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

但那里没有运气。我正在使用ayu主题。这是它现在的样子:

在我的电脑上崇高

请任何人都可以帮助我,那就太好了!

我也在Linux mint上。祝你有美好的一天!

4

1 回答 1

1

这在关于偏好的评论中有所概述:

    // 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,

关键部分是仅在Adaptive主题中默认支持此功能。

为了使标题栏成为主题,主题本身需要提供一个主题规则,并且(理想情况下)该主题规则将与此处的设置相关联。

为了在其他主题中获得主题标题栏,您需要要求主题的作者支持它,或者创建自定义。

从命令面板中选择UI: Customize Theme将打开一个类似于设置窗口的窗口,允许您将规则添加到当前主题。

这样的事情会增加对设置的支持;您可能需要将颜色调整为更匹配的颜色。此外,如果右侧窗格已经有您进行的其他自定义,只需将规则复制到文件的适当部分即可。

// 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%))",
        },
    ]
}

[编辑]

themed_title_bar仅适用于 Windows 和 MacOS;在 Linux 下它什么也不做,因为自定义窗口装饰是窗口管理器主题的工作。

在 Linux 上,有一个不同的选项,gtk_client_side_window_decorations它控制是否启用客户端窗口装饰。true如果您使用的是 gnome,则默认值为false

您可以在用户首选项中明确设置它以打开或关闭它(需要重新启动 Sublime Text)。

有关详细信息,请参阅Sublime Text 4 隐藏标题栏

于 2021-06-26T18:21:25.480 回答