在 Ubuntu 18.04 上无需切换主题即可降低应用程序标题栏的高度

vv0*_*dyk 7 gtk titlebar 18.04

例子

如何在不切换主题的情况下降低应用程序标题栏的高度?

小智 8

以上对我不起作用......但我在我的文件 ~/.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;
}
Run Code Online (Sandbox Code Playgroud)


R.S*_*R.S 7

假设您使用的是 Gnome 3 -

  1. 打开或创建文件:~/.config/gtk-3.0/gtk.css~。是当前用户的归属位置。例如,如果你的用户demo,然后~将代表\home\demo
  2. 将以下 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;    
    }    
    
    Run Code Online (Sandbox Code Playgroud)
  3. 运行ALT+F2r在出现的对话框中提供字母“ ”,然后按回车键刷新样式

有关更多信息,请参阅 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