答案1
可以减小工具栏的大小。我编写了以下 CSS 文件(在 google 的帮助下)来修改工具栏大小:
style "gtkcompact" {
GtkButton::default_border={0,0,0,0}
GtkButton::default_outside_border={0,0,0,0}
GtkButtonBox::child_min_width=0
GtkButtonBox::child_min_heigth=0
GtkButtonBox::child_internal_pad_x=0
GtkButtonBox::child_internal_pad_y=0
GtkMenu::vertical-padding=1
GtkMenuBar::internal_padding=0
GtkMenuItem::horizontal_padding=4
GtkToolbar::internal-padding=0
GtkToolbar::space-size=0
GtkOptionMenu::indicator_size=0
GtkOptionMenu::indicator_spacing=0
GtkPaned::handle_size=4
GtkRange::trough_border=0
GtkRange::stepper_spacing=0
GtkScale::value_spacing=0
GtkScrolledWindow::scrollbar_spacing=0
GtkTreeView::vertical-separator=0
GtkTreeView::horizontal-separator=0
GtkTreeView::fixed-height-mode=TRUE
GtkWidget::focus_padding=0
}
class "GtkWidget" style "gtkcompact"
# Make tabs smaller
style "compact-toolbar" {
GtkToolbar::internal-padding = 0
xthickness = 1
ythickness = 1
}
style "compact-button" {
xthickness = 0
ythickness = 0
}
style "compact-default"
{
xthickness=1
ythickness=1
}
style "compact-entry"
{
xthickness=2
ythickness=2
}
class "GtkButton" style "compact-default"
class "GtkPaned" style "compact-default"
class "GtkEntry" style "compact-entry"
class "GtkToolbar" style "compact-toolbar"
widget_class "*<GtkToolbar>*<GtkButton>" style "compact-button"
在此 CSS 中,该行class "GtkEntry" style "compact-entry"
根据 CSS 样式减小了工具栏的大小"compact-entry"
。
.gtkrc-eclipse
我通过在主目录中指定名称来保存上述文件。之后,我编写了eclipse.sh
包含以下命令的脚本,以使用我们创建的文件运行 eclipse。
export SWT_GTK3=0
env GTK2_RC_FILES=/usr/share/themes/Adwaita/gtk-2.0/gtkrc:/home/snoop/.gtkrc-eclipse /home/snoop/Mars2/eclipse
现在,使用bash eclipse.sh
我们的 CSS 样式运行 eclipse 来调用脚本。修改后的 Eclipse 工具栏如下所示: