如何降低标题栏高度?

R P*_*ppe 31 gnome3 window-title gtk3

我正在跑步GNOME 3.18,我想降低标题栏的高度。

我怎么能做到?

小智 30

在 Gnome 3.20 之后,.header-bar.default-decoration不起作用。

您可以将关注内容放入~/.config/gtk-3.0/gtk.css

/* shrink headerbars (don't forget semicolons after each property) */
headerbar {
    min-height: 0px;
    padding-left: 2px; /* same as childrens vertical margins for nicer proportions */
    padding-right: 2px;
    background-color: #2d2d2d;
}

headerbar entry,
headerbar spinbutton,
headerbar button,
headerbar separator {
    margin-top: 0px; /* same as headerbar side padding for nicer proportions */
    margin-bottom: 0px;
}

/* shrink ssd titlebars */
.default-decoration {
    min-height: 0; /* let the entry and button drive the titlebar size */
    padding: 0px;
    background-color: #2d2d2d;
}

.default-decoration .titlebutton {
    min-height: 0px; /* tweak these two props to reduce button size */
    min-width: 0px;
}

window.ssd headerbar.titlebar {
    padding-top: 3px;
    padding-bottom: 3px;
    min-height: 0;
}

window.ssd headerbar.titlebar button.titlebutton {
    padding-top: 3px;
    padding-bottom:3px;
    min-height: 0;
}
Run Code Online (Sandbox Code Playgroud)

通过https://ogbe.net/blog/gnome_titles.html

  • 这是 Robert Lu 的 CSS,经过 Brandones 和 Christian 建议的修改:https://github.com/JackKelly/linux_home/blob/master/.config/gtk-3.0/gtk.css (3认同)
  • 我还必须添加 `padding-right: 6px;` 作为第 31 行,以便在窗口标题栏的侧面和“关闭窗口”X 按钮之间放置一些填充。 (2认同)

小智 12

要减小标题栏大小,只需css在此位置创建一个文件:~/.config/gtk-3.0/gtk.css并复制粘贴下面的代码;这将调整标题栏的大小:

.header-bar.default-decoration {
        padding-top: 0px;
        padding-bottom: 0px;
    }

.header-bar.default-decoration .button.titlebutton {
    padding-top: 0px;
    padding-bottom: 0px;
}
Run Code Online (Sandbox Code Playgroud)

您可以添加此代码(在同一文件上)以删除标题栏下的行以减少大小:

/* No line below the title bar */
.ssd .titlebar {
    border-width: 0;
    box-shadow: none;
}
Run Code Online (Sandbox Code Playgroud)

ALT+ F2r在出现的框中键入并点击Enter以重新加载 gnome shell。

你很高兴去:)


小智 5

对于最大化的窗口,我可以推荐这个 Gnome Shell 扩展,它由一个deadalnix的人称为Pixel Saver。标题栏将消失(为笔记本用户提供更多空间),但您仍然可以在黑色活动栏中看到窗口标题。

在此处输入图片说明