我可以使Ubuntu上的Eclipse看起来更紧凑吗? [英] Can I make Eclipse on Ubuntu look more compact?

查看:146
本文介绍了我可以使Ubuntu上的Eclipse看起来更紧凑吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:



将一个名为 .gtkrc-2.0 的新文件添加到您的主目录中,其中包含以下内容:

  stylegtkcompact{
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 :: horizo​​ntal_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 :: horizo​​ntal-separator = 0
GtkTreeView :: fixed-height-mode = TRUE
GtkWidget :: focus_padding = 0
}
类GtkWidget样式gtkcompact

重新启动Eclipse。



浪费空间回到高效使用!






更新2014-06



现在我自己(最后)移动到开普勒,我发现小的最小化 - 最大化小部件不会去低于28像素。这些 .gtkrc-2.0 似乎对开普勒有更好的结果。

 样式gtkcompact{
GtkButton :: defaultborder = {0,0,0,0}
GtkButton :: defaultoutsideborder = {0,0,0,0}
GtkButtonBox :: childminwidth = 0
GtkButtonBox :: childminheigth = 0
GtkButtonBox :: childinternalpadx = 0
GtkButtonBox :: childinternalpady = 0
GtkMenu :: vertical-padding = 1
GtkMenuBar :: internalpadding = 0
GtkMenuItem :: horizo​​ntalpadding = 4
GtkToolbar :: internal-padding = 0
GtkToolbar :: space-size = 0
GtkOptionMenu :: indicatorsize = 0
GtkOptionMenu :: indicatorspacing = 2
GtkPaned :: handlesize = 4
GtkRange :: troughborder = 0
GtkRange :: stepperspacing = 0
GtkScale :: valuespacing = 0
GtkScrolledWindow :: scrollbarspacing = 0
GtkExpander :: expandersize = 10
GtkExpander :: expanderspacing = 0
GtkTreeView :: vertical-separator = 0
GtkTreeView :: horizo​​ntal-separator = 0
GtkTreeView :: expander-size = 8
GtkTreeView :: fixed-height-mode = TRUE
GtkWidget :: focuspadding = 1
}
类GtkWidget样式gtkcompact

stylegtkcompactextra{
xthickness = 2 ythickness = 2
}
classGtkButtonstylegtkcompactextra
classGtkToolbarstylegtkcompactextra
classGtkPanedstylegtkcompactextra

如果添加 xthickness ythickness 到整个 GtkWidget 类,你的菜单栏将被紧紧挤压一起。在我看来,这太多了,只是你知道。



你可以编辑文件并保存,打开一些简单的东西,如 Geany ,调整保存,重新打开 Geany 等,以快速调整这一点。有关详细信息,您可以每次打开Eclipse,但加载时间需要更长时间,具体取决于您需要加载多少插件。



更新2015-10-02



关于Luna和Mars



@eocanha在jan 15说:


如果您安装了Gtk3,Eclipse Luna将使用基于Gtk3 CSS的样式系统,并忽略.gtkrc-2.0。但是,您可以通过shell环境变量强制Eclipse再次使用Gtk2(如果已安装):.bashrc中的export SWT_GTK3 = 0或调用Eclipse的某些包装器脚本。原始来源:bugs.eclipse.org/bugs/show_bug.cgi?id=420180



Possible Duplicate:
Gigantic Tabs in Eclipse on Ubuntu

Back when I was using Eclipse on Ubuntu 10.04 LTS, I found that the tabs and bars used a bit too much vertical spacing, which made the interface a bit too spacey for my taste.

However, I didn't find a good way to make this right, and I learned to work with it.

But now, after installing Ubuntu 12.10 (or actually Linux Mint 14 Cinnamon), it has gotten even bigger, the vertical spacing.

If you have three tabbed windows with two toolbars in your normal vertical workspace, this easily hides 6 lines of code with useless UI spacing, which I personally find quite annoying.

Before screenshot (a bit too spacey) | After screenshot (annoyingly spacey):

I personally don't like this and I would prefer to get rid of it. I have tried some GTK3 themes and they left stuff almost equally spacey, adding or removing maybe an extra pixel.

I have traveled deep into the preferences of Eclipse itself and I have seen many things. I am not sure if I was distracted or there is just no way of changing this from within Eclipse itself, but I didn't find any.

How do I turn this oversized touch interface for people with 4K screens back into a compact interface for programmers who want to see lots of code?

or

How do I brutally do this myself in /usr/share/themes/*/gtk-3.0/*css?

解决方案

I have been looking everywhere for a GTK3 solution, because I was sure the switch to a GTK3 system caused this. However, after two hours of wasting my time, I found out that the 'old GTK2 trick' just works.

The original forum post is here: http://ubuntuforums.org/showthread.php?t=1465712

Add a new file called .gtkrc-2.0 to your home directory with the following content:

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"

Restart Eclipse.

Wasted space back to efficient use!

Update 2014-06

Now that I myself have (finally) moved to Kepler, I found that the little minimize-maximize widgets wouldn't go below 28 pixels anymore. These .gtkrc-2.0 seem to have better results for Kepler.

style "gtkcompact" { 
  GtkButton::defaultborder={0,0,0,0} 
  GtkButton::defaultoutsideborder={0,0,0,0} 
  GtkButtonBox::childminwidth=0 
  GtkButtonBox::childminheigth=0 
  GtkButtonBox::childinternalpadx=0 
  GtkButtonBox::childinternalpady=0 
  GtkMenu::vertical-padding=1 
  GtkMenuBar::internalpadding=0 
  GtkMenuItem::horizontalpadding=4
  GtkToolbar::internal-padding=0 
  GtkToolbar::space-size=0 
  GtkOptionMenu::indicatorsize=0 
  GtkOptionMenu::indicatorspacing=2 
  GtkPaned::handlesize=4 
  GtkRange::troughborder=0 
  GtkRange::stepperspacing=0 
  GtkScale::valuespacing=0 
  GtkScrolledWindow::scrollbarspacing=0 
  GtkExpander::expandersize=10 
  GtkExpander::expanderspacing=0 
  GtkTreeView::vertical-separator=0 
  GtkTreeView::horizontal-separator=0 
  GtkTreeView::expander-size=8 
  GtkTreeView::fixed-height-mode=TRUE 
  GtkWidget::focuspadding=1 
} 
class "GtkWidget" style "gtkcompact"

style "gtkcompactextra" { 
  xthickness=2 ythickness=2 
} 
class "GtkButton" style "gtkcompactextra"
class "GtkToolbar" style "gtkcompactextra"
class "GtkPaned" style "gtkcompactextra"

If you add the xthickness and ythickness to the whole GtkWidget class, your menu bar will be all tight and squeezed together. That's too much in my opinion, but just so you know.

You can edit the file and save it, open up something simple like Geany, tweak save, re-open Geany etc. to quickly tweak this. For details you can open Eclipse every time, but it takes longer to load, depending on how much plugins you have to load.

Update 2015-10-02

About Luna and Mars

@eocanha said at jan 15:

If you have Gtk3 installed, Eclipse Luna will use the Gtk3 CSS based styling system and will ignore .gtkrc-2.0. However, you can force Eclipse to use Gtk2 again (if you have it installed) via shell environment variables: "export SWT_GTK3=0" in your .bashrc or in some wrapper script calling Eclipse. Original source: bugs.eclipse.org/bugs/show_bug.cgi?id=420180

这篇关于我可以使Ubuntu上的Eclipse看起来更紧凑吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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