答案1
上述方法对我来说不起作用...但我在文件 ~/.config/gtk-3.0/gtk.css 中使用以下内容获得了良好的结果:
/*
* Reduce height of window header (title?) bars.
* Seems enough to specify padding, no need to repeat
* padding-left padding-right padding-top padding-bottom
* nor it seems necessary to even mention
* margin-top margin-bottom
*/
.default-decoration {
min-height: 0px;
padding: 3px;
}
.default-decoration .titlebutton {
min-height: 0px;
padding: 0px;
}
答案2
假设你正在使用 Gnome 3 -
- 打开或创建文件:(
~/.config/gtk-3.0/gtk.css
是~
您当前用户的主位置。例如,如果您的用户是demo
,则~
代表\home\demo
) 将以下 CSS 添加到文件
headerbar entry, headerbar spinbutton, headerbar button, headerbar separator { margin-top: 0px; /* same as headerbar side padding for nicer proportions */ margin-bottom: 0px; } headerbar { min-height: 24px; padding-left: 2px; /* same as childrens vertical margins for nicer proportions */ padding-right: 2px; margin: 0px; /* same as headerbar side padding for nicer proportions */ padding: 0px; }
运行并在出现的对话框中
ALT+F2
输入字母“ ”,然后按回车键刷新样式r
欲了解更多信息,请参考 Unix Stackexchange 的原始解决方案:https://unix.stackexchange.com/questions/276951/how-to-change-the-titlebar-height-in-standard-gtk-apps-and-those-with-headerbars?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa