如何更改 GNOME 中活动窗口标题栏的颜色?

Max*_*ver 5 theme gnome3 gtk3

我在 StackExchange 上找到了如何更改非活动窗口标题栏的颜色(在 GNOME 3 中):

~/.config/gtk-3.0/gtk.css:

headerbar.default-decoration {
    background-color: #c00; /* red */
}
Run Code Online (Sandbox Code Playgroud)

(参见这个问题:How to Change the titlebar height in standard GTK apps and those with headerbars/CSDs on Gnome 3.20

非活动窗口以 #c00 着色

但是我怎样才能只改变活动窗口的颜色呢?

kan*_*ili 1

我想说这是不正确的。headerbar:backdrop应该是针对非活动窗口的窗口,headerbar针对活动窗口的窗口。我使用 headerbar {...} 来设置颜色,例如:

    headerbar {
  padding: 0 6px;
  min-height: 46px;
  border-width: 0 0 1px;
  border-style: solid;
  border-color: @border_color;
  background: @bg_color linear-gradient(to bottom, shade(@bg_color,1.2), shade(@bg_color, 0.8));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.8); }
Run Code Online (Sandbox Code Playgroud)

对于我使用的非活动窗口:

  headerbar:backdrop {
    background-image: linear-gradient(to bottom, shade(@bg_color,1.2), shade(@bg_color, 0.8));
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.8);
    transition: 200ms ease-out; }
Run Code Online (Sandbox Code Playgroud)

您可以使用它background-color来代替它,background-image但我不喜欢它;-) 请注意,以 @ 为前缀的颜色是主题的一部分,必须定义。您可以使用 rgb 表示法代替它们(例如 #FF0000 表示红色)

如果您使用颜色概念,请务必将背景图像设置为无