Ubuntu 上 Eclipse 中的巨大选项卡

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2743647/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 14:41:39  来源:igfitidea点击:

Gigantic Tabs in Eclipse on Ubuntu

eclipseubuntuuser-interfacegtk

提问by Zack

EDIT: For anyone coming to this question through searching, you can install a Gnome Theme called Clearlooks Compactto shorten your tabs in Eclipse. This will free up a lotof screen space. You can also check out the answer below to learn how to make the tabs more horizontally compact.

编辑:对于通过搜索来解决这个问题的任何人,您可以安装一个名为Clearlooks Compact的 Gnome 主题来缩短 Eclipse 中的选项卡。这将释放大量屏幕空间。您还可以查看下面的答案以了解如何使选项卡在水平方向上更加紧凑。



Short version: How do I make a short version of Eclipse's tabs & toolbars in Ubuntu?

简短版本:如何在 Ubuntu 中制作 Eclipse 选项卡和工具栏的简短版本?

I've been looking around for a fix to this on Google, but to no avail. With any GTK theme, I still have this same issue and it's very, very annoying--to the point where I've stopped using Eclipse in favor of gEdit. However, after running pylint from a terminal too. many. times. I've decided I need to find a solution to this issues with Eclipse so I can have PyDev back. Here's what the tabs look like:

我一直在 Google 上寻找解决此问题的方法,但无济于事。对于任何 GTK 主题,我仍然有同样的问题,而且非常非常烦人——以至于我已经停止使用 Eclipse 而支持 gEdit。但是,在从终端运行 pylint 之后。许多。次。我决定我需要用 Eclipse 找到解决这个问题的方法,这样我才能让 PyDev 回来。以下是选项卡的外观:

alt text http://c0496682.cdn.cloudfiles.rackspacecloud.com/big-tabs.png

替代文字 http://c0496682.cdn.cloudfiles.rackspacecloud.com/big-tabs.png

As you can see, not only are the tabs exaggerated, but the toolbar is, too: so is the toolbar on the bottom; so are the tabs in the bottom pane. Overall, it's eating up a lot of screen space, which is a hard item to come by on a 17" screen. Any suggestions/fixes?

如您所见,不仅选项卡被夸大了,工具栏也被夸大了:底部的工具栏也是如此;底部窗格中的选项卡也是如此。总体而言,它占用了大量屏幕空间,这在 17 英寸屏幕上很难实现。有什么建议/修复吗?

采纳答案by phoenix24

I too have suffered from this quite a bit, before I found the solution by changing the general appearance of my IDE.

在我通过更改 IDE 的总体外观找到解决方案之前,我也遭受了很多痛苦。

You can try and customize the look-and-feel or you Eclipse Environment from,

您可以尝试自定义外观或您的 Eclipse 环境,

Go to : Window -> Preferences -> General -> Appearance.

转到:窗口 -> 首选项 -> 常规 -> 外观。

try setting,

尝试设置,

  1. Current Presentation to " Default ".
  2. Enable " Traditional Style Tabs " (for rectangular tabs.)
  3. Disable Animation ( if you don't like swoosh effect.)
  1. 当前演示文稿为“默认”。
  2. 启用“传统样式选项卡”(用于矩形选项卡。)
  3. 禁用动画(如果你不喜欢旋风效果。)

回答by Varun Mehta

This can be solved changing your GTK settings;

这可以通过更改您的 GTK 设置来解决;

gedit ~/.gtkrc-2.0

Then add this;

然后加上这个;

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"

borrowed from http://ubuntuforums.org/showthread.php?t=1465712

借自http://ubuntuforums.org/showthread.php?t=1465712

回答by Ronan Jouchet

In addition to @Varun Mehta answer, I recommend the following tips for Eclipse 4 (Juno), whose interface is partially dictated and configurable by CSS rules:

除了@Varun Mehta 的回答,我还为 Eclipse 4 (Juno) 推荐以下提示,其界面部分由 CSS 规则决定和配置:

In YourEclipseDir/plugins/org.eclipse.platform_4.x.y.v2012zzzzzzzz/css, edit:

YourEclipseDir/plugins/org.eclipse.platform_4.x.y.v2012zzzzzzzz/css,编辑:

  • e4_basestyle.css
  • e4_default.css
  • e4_default_gtk.css
  • e4_basestyle.css
  • e4_default.css
  • e4_default_gtk.css

... and adjust those files. I use the following set of tweaks:

...并调整这些文件。我使用以下一组调整:

  • set all the margin-*and paddingto 0
  • set swt-shadow-visible: falseeverywhere you find it, to get rid of those huge shadows
  • set .MPartStack {font-size}to something smaller than 12
  • 将所有margin-*和设置padding0
  • 设置swt-shadow-visible: false在你发现它的任何地方,以摆脱那些巨大的阴影
  • 设置.MPartStack {font-size}为小于12

Finally, remember you can disable the toolbar. In 4.0, its state wasn't remembered across sessions, but it seems like the issue is solved in 4.2.1

最后,请记住您可以禁用工具栏。在 4.0 中,它的状态不会跨会话记住,但似乎问题在 4.2.1 中得到解决

Bonus resources: Eclipse4/CSSwill get you started on Eclipse4 CSS, E4/CSS/SWT Mappinglists other interesting CSS attributes, and CSS Spywill help you inspect the UI.

额外资源:Eclipse4/CSS将帮助您开始学习 Eclipse4 CSS,E4/CSS/SWT Mapping列出了其他有趣的 CSS 属性,CSS Spy将帮助您检查 UI。

Screenshot of what I end up with: enter image description here

我最终得到的截图: 在此处输入图片说明

EDIT: see also How to remove the close (×) button from Eclipse Juno tabs?

编辑:另请参阅如何从 Eclipse Juno 选项卡中删除关闭 (×) 按钮?

回答by Zarokka

In Addition to Ronans answer, it is possible to change the height of the tabs directly in Eclipse Juno.

除了 Ronans 的回答之外,还可以直接在 Eclipse Juno 中更改选项卡的高度。

edit the css file of your current style (e.g. e4_default_gtk.css) and add

编辑当前样式的 css 文件(例如 e4_default_gtk.css)并添加

CTabFolder {
   tab-height: 16px;
}

Note: CTabFolder ... not add this to CTabFolder Canvas!

注意:CTabFolder ...不要将其添加到CTabFolder Canvas!

回答by VonC

Note: the Default Eclipse 4 just got a bit better with bug 420238closed:

注意:由于关闭了错误 420238,默认 Eclipse 4 变得更好了:

[CSS] Reduce whitespace usage in the default Eclipse themes

[CSS] 减少默认 Eclipse 主题中的空白使用

Before:

前:

http://blog.vogella.com/wp-content/uploads/2014/01/Java-test-src-test-Main.java-vogella-Development-Tools-_009.png

http://blog.vogella.com/wp-content/uploads/2014/01/Java-test-src-test-Main.java-vogella-Development-Tools-_009.png

After:

后:

http://blog.vogella.com/wp-content/uploads/2014/01/Java-test-src-test-Main.java-vogella-Development-Tools-_010.png

http://blog.vogella.com/wp-content/uploads/2014/01/Java-test-src-test-Main.java-vogella-Development-Tools-_010.png

See Lars Vogel's articleabout it:

参见Lars Vogel关于它的文章

If you fire up the next Eclipse 4.4 milestone build, Eclipse uses much less whitespace and leaves more space for the important content.

如果您启动下一个 Eclipse 4.4 里程碑构建,Eclipse 将使用更少的空白并为重要内容留出更多空间。

(That would be 4.4 M5)

(那将是 4.4 M5)

While this is on a technical level a trivial change, I hope that this will improve the initial perception people have in using Eclipse.

A big thanks to Daniel Rolka, Robin Stocker and Dani Megert for doing the majority of the work and a big thanks all involved parties in the Bug report to get this change accepted.

虽然这在技术层面上是一个微不足道的变化,但我希望这将改善人们在使用 Eclipse 时的初步看法。

非常感谢 Daniel Rolka、Robin Stocker 和 Dani Megert 所做的大部分工作,并非常感谢 Bug 报告中的所有相关方让此更改被接受。

回答by Zack

If you really want to make the tabs nice an' short, take a gander at Clearlooks Compact.

如果您真的想让标签变得更短,请查看Clearlooks Compact

I preferred to just hit the whole IDE with a splash of "meh," so here's what I ended up with.

我更喜欢用“meh”的飞溅声击中整个 IDE,所以就是我最终得到的。