Eclipse:更改垂直条颜色

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16449728/
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 20:28:16  来源:igfitidea点击:

Eclipse: change vertical bar color

eclipse

提问by Eike Cochu

trying to deal with a minor issue here: I want to make my eclipse as distraction free as possible. So far I'm satisfied, except for one thing that I've not been able to figure out how to change:

试图在这里处理一个小问题:我想让我的日食尽可能不受干扰。到目前为止,我很满意,除了一件事我无法弄清楚如何改变:

eclipse screenshot with white annoying bars

带有白色烦人条的 Eclipse 屏幕截图

the white vertical bars are ... annoying. How can I change their color?

白色的竖条是……烦人的。我怎样才能改变它们的颜色?

Please note that the left ruler is not the code folding bar (which is on the right side of the line numbers), but the so called "vertical ruler" which shows line annotations (eg errors and stuff), to be found in Preferences > General > Editors > Text Editors > Annotations. This bar can not be deactivated (which I don"t want because i find it useful), I just want its color changed. Don't know what the right ruler is though.

请注意左边的标尺不是代码折叠栏(在行号的右侧),而是所谓的“垂直标尺”,它显示行注释(例如错误和内容),可在首选项>常规 > 编辑器 > 文本编辑器 > 注释。这个栏不能被停用(我不想要,因为我觉得它很有用),我只想改变它的颜色。不知道什么是正确的标尺。

not a duplicate of Vertical white line on eclipseor Is it possible to make Eclipse's code-folding gutter black?

不是eclipse垂直白线的副本,或者是否有可能使 Eclipse 的代码折叠装订线变黑?

edit: but indeed a (partial) duplicate of Change overview ruler color in Eclipse. Problem not solved: changing the system theme (mine is mediterranean dark) did not change the color of the bar.

编辑:但确实是Eclipse更改概览标尺颜色的(部分)副本。问题未解决:更改系统主题(我的是地中海深色)没有更改栏的颜色。

Thank you

谢谢

回答by Eike Cochu

Found it myself, sharing it for others who want to customize their bar color:

自己找到的,分享给想要自定义条形颜色的其他人:

#org-eclipse-e4-ui-compatibility-editor * { background-color: #002b36; }

change the hex value to anything you like. This css snippet has to be added to eclipse in some way (I did it with eclipse Chrome Theme http://marketplace.eclipse.org/content/eclipse-4-chrome-theme#.UYrzEkAW1J0)

将十六进制值更改为您喜欢的任何值。这个css片段必须以某种方式添加到eclipse中(我用eclipse Chrome Theme http://marketplace.eclipse.org/content/eclipse-4-chrome-theme#.UYrzEkAW1J0

FYI: I found the css id with the "css spy" from the eclipse tooling collection (http://marketplace.eclipse.org/content/eclipse-4-tools-css-spy#.UYrzSkAW1J0)

仅供参考:我从 eclipse 工具集合 ( http://marketplace.eclipse.org/content/eclipse-4-tools-css-spy#.UYrzSkAW1J0) 中找到了带有“css spy”的 css id

result:

结果:

styled eclipse

风格日食

回答by n0doze89

Btw, It looks like you can actually just disable this bar by going to Preferences > General > Editors > Text Editors. Then just uncheck the box labeled "Show range indicator".

顺便说一句,看起来您实际上可以通过转到“首选项”>“常规”>“编辑器”>“文本编辑器”来禁用此栏。然后只需取消选中标有“显示范围指示器”的框。

回答by shiratori

Thanks for sharing your solution. I could apply the code by just adding to CSS files in eclipse\plugins\org.eclipse.platform_4.3.1.v20130911-1000\css.

感谢您分享您的解决方案。我可以通过添加到 .css 文件中的 CSS 文件来应用代码eclipse\plugins\org.eclipse.platform_4.3.1.v20130911-1000\css

I use Windows 7 theme so added to e4_default_win7.css. And I slightly modified the rule to have less side effect (occurrence markers were hard to see with the colors set by color theme).

我使用 Windows 7 主题,因此添加到e4_default_win7.css. 我稍微修改了规则以减少副作用(使用颜色主题设置的颜色很难看到出现标记)。

#org-eclipse-e4-ui-compatibility-editor Composite > Canvas {
    background-color: #232323;
}

回答by Tyc

I had a similar problem, but for me with Neon .2 on windows it was the unfold bar that stayed white. After I disabled unfold and enabled it, the bar stayed black(for now). But you could also just keep it disabled. It is shown in the link below.

我有一个类似的问题,但对我来说,窗户上的 Neon .2 是展开栏保持白色。在我禁用展开并启用它之后,栏保持黑色(现在)。但是你也可以让它保持禁用状态。它显示在下面的链接中。

enter image description herelink to the PrntScrn to disable unfold bar

在此处输入图片说明链接到 PrntScrn 以禁用展开栏