减少 gnome 终端中的标签栏高度 [英] Decrease the tabs bar height in gnome terminal

查看:32
本文介绍了减少 gnome 终端中的标签栏高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近用 gnome-terminal 安装了 Lubuntu 16.04.我喜欢 gnome-terminal 在显示器上消耗更少的空间.但是最新版本的右上角有两个烦人的按钮,这对我来说毫无意义.因为,喜欢终端的用户更有可能使用键盘快捷键来执行选项卡操作,而不是点击鼠标.有了这两个额外的按钮,标签栏变得更宽,并在显示器上占用更多空间.

之后:

更新:实际上从右上角的选项卡菜单栏中删除两个按钮(根据 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

I recently installed Lubuntu 16.04 with gnome-terminal. I like gnome-terminal to consume less space on monitor. But latest version comes with two annoying buttons at the right top corner which makes no sense to me. Because, user who prefer terminals are more likely to use keyboard shortcuts to do tabs operations rather than go for mouse clicks. With these two extra buttons tabs bar got wider and uses more space on the monitor. Click here for Screenshot . Please help me in removing this extra two buttons from the gnome-terminal window.

Thanks in Advance

Madhusudhan

解决方案

As I am running gnome shell 3.22.2 (same as izy) which ships with gnome-terminal 3.22.1 (under Arch), the solution posted by Lari Hotari doesn't work for me. It turns out that the CSS class name has changed in bug report #765590. The name is now terminal-window instead of TerminalWindow. This has been shipping with gnome since 3.20.2-ish.

The following snippet for ~/.config/gtk-3.0/gtk.css reduces the vertical size of gnome-terminal by 10px for me. Note that I tried hiding the two buttons by setting display: none but this has no effect. Maybe gtk-3.0 does not allow hiding ui elements (no idea).

/* 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;
}

Make sure to logout/login out of gnome-session after changing the css file.

Before:

After:

Update: actually removing the two buttons from the tabs menu bar in the top right corner (as requested by the OP) requires you to re-compile gnome-terminal (it isn't that difficult with apt source under ubuntu). Just remove the terminal_window_fill_notebook_action_box call on line 2792 in src/terminal-window.c: https://github.com/GNOME/gnome-terminal/blob/8975986d51639040ceb6ba1c0dc78f6a3fa9da45/src/terminal-window.c#L2792

这篇关于减少 gnome 终端中的标签栏高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆