【问题标题】:Themed title bar not working in sublime text 4主题标题栏在 sublime text 4 中不起作用
【发布时间】:2021-09-09 15:33:38
【问题描述】:

我将 sublime text 3 更新到版本 4,在 there article 中,他们说:

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

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

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

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

请任何人都可以帮助我,这将是很棒的!

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

【问题讨论】:

    标签: sublimetext titlebar sublimetext4


    【解决方案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 控制是否启用客户端窗口装饰。如果您使用的是 gnome,则默认值为 true,否则为 false

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

    更多详情请见Sublime Text 4 hide title bar

    【讨论】:

    • Idk 为什么这不起作用,是不是我在 linux mint 上的东西。我快疯了。
    • 感谢我的工作,我刚刚添加了您告诉的规则,gtk_client_side_window_decorations 将其设置为 true 并且有效,感谢查看我自己的答案,看看它现在看起来有多酷
    • 嗨@OdatNurd,我们已经围绕 ST 问题讨论了几次 :) 作为 ST 在 SO 上的顶级用户,您对 stackoverflow.com/questions/68175111/… 有什么想法吗?
    猜你喜欢
    • 2021-08-12
    • 1970-01-01
    • 2016-09-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多