如何在 Eclipse 中更改导航器视图的背景颜色?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2569364/
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
How do I change the background color of the Navigator view in eclipse?
提问by rrva
I didn't find any option for that, so I suspect that some views follow the color pattern of the operating system. I'm currently using OS X, and it seems like changing the default background color it's not possible either.
我没有找到任何选项,所以我怀疑某些视图遵循操作系统的颜色模式。我目前正在使用 OS X,似乎也无法更改默认背景颜色。
What I'm trying to accomplish is to create a dark background theme, but customization seems only possible on some of the eclipse views.
我想要完成的是创建一个深色背景主题,但似乎只能在某些 eclipse 视图上进行自定义。
采纳答案by VonC
As mentioned in "Changing UI color in Eclipse":
正如“在 Eclipse 中更改 UI 颜色”中所述:
Each time you see white or gray color, this is more than likely related to OS system colors.
每次您看到白色或灰色时,这很可能与 OS 系统颜色有关。
(that is, for everything which is not an editor or a custom view).
(也就是说,对于不是编辑器或自定义视图的所有内容)。
This is likely the case for the navigator view, as reminded in "How to change background of all VIEWS in Eclipse IDE ?"
导航器视图可能就是这种情况,如“如何更改 Eclipse IDE 中所有视图的背景?”中所述。
回答by rrva
For platforms where eclipse uses gtk (Linux for example) one can use a custom gtkrc file (place it for example in the eclipse base directory)
对于 eclipse 使用 gtk 的平台(例如 Linux),可以使用自定义 gtkrc 文件(例如将其放在 eclipse 基目录中)
style "eclipse" {
base[NORMAL] = "#FDF6E3"
fg[SELECTED] = "#FDF6E3"
base[SELECTED] = "#073642"
fg[NORMAL] = "#073642"
text[NORMAL] = "#073642"
base[ACTIVE] = "#073642"
}
class "GtkWidget" style "eclipse"
And a custom start script for eclipse
以及 eclipse 的自定义启动脚本
#!/bin/sh
GTK2_RC_FILES=gtkrc ./eclipse
Got the solution from http://blog.sarathonline.com/2008/10/solved-eclipse-looks-good-in-ubuntu-now.html
从http://blog.sarathonline.com/2008/10/solved-eclipse-looks-good-in-ubuntu-now.html得到解决方案
Combine this with the color themes pluginfor coloring the editors
将此与颜色主题插件结合起来为编辑器着色
回答by Ansar Ozden
My case is: Eclipse ver. 2018-09, Win 10. Eclipse install folder: C:\eclipse\eclipse-2018-09
我的情况是:Eclipse 版本。2018-09,Win 10.Eclipse安装文件夹:C:\eclipse\eclipse-2018-09
I compared 2 files: 1) C:\eclipse\eclipse-2018-09\plugins\org.eclipse.ui.themes_1.2.200.v20180828-1350\css\e4_basestyle.css 2) C:\eclipse\eclipse-2018-09\plugins\org.eclipse.ui.themes_1.2.200.v20180828-1350\css\e4-dark.css
我比较了 2 个文件:1) C:\eclipse\eclipse-2018-09\plugins\org.eclipse.ui.themes_1.2.200.v20180828-1350\css\e4_basestyle.css 2) C:\eclipse\eclipse-2018- 09\plugins\org.eclipse.ui.themes_1.2.200.v20180828-1350\css\e4-dark.css
And find out css selector "CTabFolder Tree, CTabFolder Canvas" is present in dark, but absent in basestyle.
并找出css选择器“CTabFolder Tree,CTabFolder Canvas”在黑暗中存在,但在basestyle中不存在。
Add this selector in file "e4_basestyle.css"
在文件“e4_basestyle.css”中添加这个选择器
CTabFolder Tree, CTabFolder Canvas {
background-color: #dddddd;
color: #000;
}
and You can tune color for nav view.
并且您可以调整导航视图的颜色。
Then select theme "Light" in Preferences->General->Appearance and click "Apply".
然后在 Preferences->General->Appearance 中选择主题“Light”并点击“Apply”。
回答by Cyrille37
When Git is present, Project Explorer colors can be altered via Preferences > General > Apparearance > Colors and Fonts > Git
当 Git 存在时,可以通过 Preferences > General > Apparearance > Colors and Fonts > Git 更改 Project Explorer 的颜色