How to set font and colors of Eclipse UI

The original URL of this article is https://codeyarns.com/2014/11/03/how-to-set-font-and-font-size-of-eclipse-ui/

 Qestion: How to change the icon's color of three view? (That's the color of > before a item of project view.)

 

The font, font size and colors of most of the UI elements of Eclipse can be changed. Some of them can be set from inside Eclipse, others can be set in the CSS files used by the current Eclipse theme. There are other elements which can be changed only by modifying the settings of the current GTK or GNOME theme.

Inside Eclipse

Based on the current theme that Eclipse is using, many of the settings are in CSS files.

  • Font and fonts sizes of editor, console, dialog and other UI elements can be changed from Window -> Preferences -> General -> Appearance -> Colors and Fonts.

However, you will find that the font and font sizes of Project Explorer, Outline, Problems, Make and many other UI windows which hold tree-like elements cannot be changed from here. To do that you need to modify the CSS file of the theme you are current using. Here is how to do that:

  • Find out what is the current theme that Eclipse is using. You can see that in Window -> Preferences -> General -> Appearance. For example, I found that mine was using the theme GTK and the Color and Font theme was Default.

     

  • Go to the install directory of Eclipse and go to the themes CSS directory. For example, on my system this was plugins/org.eclipse.ui.themes_1.0.1.v20140819-1717/css.

  • Open the CSS file that corresponds to the theme that Eclipse is currently using. For example, for my theme I found the file e4_default_gtk.css.

  • Add this CSS style to change the font and font size. For example, to set to font Arial with size 8, I would add:

1
2
3
4
.MPart Tree {
     font-family: Consolas;
     font-size: 8;
}
  • Close the file. Close Eclipse and open it back again. You should be able to see the change in Project Explorer, Outline, and other windows that have tree-like UI elements.

Outside Eclipse

转载于:https://www.cnblogs.com/clblacksmith/p/10763217.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值