如何在Gnome 3.20上的标准GTK应用程序和带有标题栏/ CSD的应用程序中更改标题栏的高度

黄el

在侏儒3.18,这是可以通过在改变的CSS改变所有窗口的标题栏高度~/.config/gtk-3.0/gtk.css按照在侏儒3 / GTK + 3减少标题栏高度

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

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

/* No line below the title bar */
.ssd .titlebar {
    border-width: 0;
    box-shadow: none;
}

在Gnome 3.20中,这似乎不再适用于带有标题栏/ CSD(标题栏中的gnome特定按钮)的窗口,例如Nautilus(文件),设置,照片,联系人等。该调整仍会减小标题栏的高度用于其他应用程序,例如gnome-terminal和gVim。如何在gnome程序(例如Gnome 3.20中的Nautilus)中减小标题栏的高度?


更新

我还尝试了此reddit线程中的建议我都尝试window.ssd.ssd唯一, 没有骰子。 这有效,请参阅我发布的答案以获取更多详细信息

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

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

/* shrink headebars */
headerbar {
    min-height: 38px;
    padding-left: 2px; /* same as childrens vertical margins for nicer proportions */
    padding-right: 2px;
}

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

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

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

标题栏/ CSD

实际上,我通过reddit找到并在上面发布的一部分代码,即

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

是否修改标题栏/ CSD。但是效果不是立竿见影的。即使重新加载了gnome,也可能需要关闭所有窗口,稍等片刻,或者注销并重新登录以查看效果。

修改以下内容时,我仍然看不到标题栏中的任何区别。

headerbar {
    min-height: 38px;
    padding-left: 2px; /* same as children's vertical margins for nicer proportions */
    padding-right: 2px;
}

标准标题栏

普通窗口标题栏的两个部分按预期工作。

.default-decoration {
    min-height: 0; /* let the entry and button drive the titlebar size */
    padding: 2px
}

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

标题栏边框

如果正在运行默认的adwaita主题,则可以使用以下命令删除标题栏边框。来自https://bbs.archlinux.org/viewtopic.php?id=211102

window.ssd headerbar.titlebar {
  border: none;
  background-image: linear-gradient(to bottom,
  shade(@theme_bg_color, 1.05),
  shade(@theme_bg_color, 0.99));
  box-shadow: inset 0 1px shade(@theme_bg_color, 1.4);
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

如何在RPi3上的交叉编译应用程序的MainWindow上显示边框和标题栏?

如何更改最近应用程序菜单中应用程序标题栏的颜色?

如何在Mac OS X标题栏中更改java swing应用程序标题?

如何从Gtk应用程序在Gnome Shell中创建标题栏菜单

如何在Qt的应用程序标题栏中添加带有上下文菜单的按钮?

更改带有GTK3主题的新Gnome 3标题栏的外观

如何在 PWA 的标题栏中添加按钮(Web 应用程序)

如何在标题栏中设置图标,包括应用程序名称

在 Ubuntu 18.04 中从 GNOME 的标题栏中删除应用程序图标

如何摆脱Microsoft Office应用程序标题栏中的难看装饰?

如何删除 Java Swing 应用程序上的原生 mac 标题栏

使用Gnome3在Ubuntu中程序没有标题栏和边框是否正常?

Gnome 3标题栏上的方块

Gnome下的Java Swing应用程序-使用Adwaita(深色皮肤)窗口标题栏

如何在gnome-3中为标题栏设置主题/样式?

如何自定义电子应用程序的窗口标题栏?

如何创建覆盖Windows标题栏的Java Swing应用程序?

如何为UWP页面自定义应用程序标题栏

如何快速为OS X应用程序的标题栏着色

更改Visual Studio 2013和/或Office应用程序的窗口标题栏的高度

如何使用MahApps在所有应用程序窗口上设置Windows 10标题栏按钮样式

如果未在标题栏中显示该应用程序,则如何知道该应用程序是以管理员身份运行的?

如何在AS3中制作没有标题栏和控件的SWF文件?

如何在GNOME 3中编辑“应用程序”菜单?

如何在Ubuntu 16.04上启用GTK3标题栏?

如何在GTK + 3中设置标题栏关闭按钮的主题?

如何在Android的标题栏中隐藏应用名称?

如何在UWP应用中隐藏/折叠标题栏?

Android:如何在操作栏中更改标题,但保持应用程序名称不变?