减少gnome终端中的标签栏高度

Mad*_*ula 10 css ubuntu tabs gnome-terminal gtk3

我最近用gnome-terminal安装了Lubuntu 16.04.我喜欢gnome-terminal在显示器上占用更少的空间.但是最新版本的右上角有两个恼人的按钮,这对我来说毫无意义.因为,喜欢终端的用户更有可能使用键盘快捷键来执行标签操作,而不是点击鼠标.使用这两个额外的按钮,标签栏变得更宽,并在显示器上占用更多空间.点击此处查看截图 .请帮我从gnome-terminal窗口中删除这两个额外的按钮.

提前致谢

Madhusudhan

log*_*ion 13

当我运行与gnome-terminal 3.22.1(Arch下)一起运行的gnome shell 3.22.2(与izy相同)时,Lari Hotari发布的解决方案对我不起作用.事实证明,CSS类名称在错误报告#765590中已更改.名称现在是终端窗口而不是TerminalWindow.自3.20.2-ish以来,这已经与gnome一起发货.

以下代码片段为我~/.config/gtk-3.0/gtk.css减少了gnome-terminal的垂直大小10px.请注意,我尝试通过设置display:none来隐藏这两个按钮,但这没有任何效果.也许gtk-3.0不允许隐藏ui元素(不知道).

/* Decrease the tabs bar height in gnome-terminal
 * See:
 * https://stackoverflow.com/questions/36869701/decrease-the-tabs-bar-height-in-gnome-terminal
 */

terminal-window notebook > header.top button {
  padding: 0 0 0 0;
  background-image: none;
  border: 0;
  margin-right: 10px;
}
terminal-window notebook > header.top > tabs > tab {
  margin: 0 0 0 0;
  padding: 0 0 0 0;
}
terminal-window notebook > header.top > tabs > tab label {
  padding: 0 0 0 0;
  margin: 0 0 0 0;
}
Run Code Online (Sandbox Code Playgroud)

确保在更改css文件后注销/登出gnome-session.

之前: 修改前的屏幕截图

后: 修改后的屏幕截图

更新:实际上从右上角的标签菜单栏中删除了两个按钮(按照OP的要求)要求你重新编译gnome-terminal(在ubuntu下使用apt源并不困难).只需删除src/terminal-window.c中第2792行的terminal_window_fill_notebook_action_box调用:https://github.com/GNOME/gnome-terminal/blob/8975986d51639040ceb6ba1c0dc78f6a3fa9da45/src/terminal-window.c#L2792


Lar*_*ari 4

添加这个~/.config/gtk-3.0/gtk.css对我有用。它不会删除按钮,但使它们更适合深色主题并使用更少的垂直空间。

TerminalWindow .notebook .button,
TerminalWindow .notebook .button:active {
    padding: 2 2 2 10;
    background-image: none;
    border: 0;
}
Run Code Online (Sandbox Code Playgroud)

我正在使用这种定制,与深色主题配合得很好:

@define-color bg-grey #222;
@define-color active-grey #333;
@define-color border-grey #555;

TerminalWindow .notebook {
  border: 0;
  padding: 0;
  color: #eee;
  background-color: shade(@active-grey, 1);
}

TerminalWindow .notebook tab:active {
  border: 1px solid @border-grey;
  background-color: shade(@active-grey, 1);
}

TerminalWindow .notebook tab {
  background-color: shade(@bg-grey, 1);
}

TerminalWindow .notebook .button,
TerminalWindow .notebook .button:active {
    padding: 2 2 2 10;
    background-image: none;
    border: 0;
}
Run Code Online (Sandbox Code Playgroud)