Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
941 views
in Technique[技术] by (71.8m points)

ubuntu - Change Eclipse sidebar vertical scope highlighting

I just installed Ubuntu after using Eclipse on Windows 8 for some time. The only thing I can't figure out how to modify is the color of the vertical bar when you're working under a current class or method in a file.

Example: in Windows the default was this lovely blue as shown below:


enter image description here

But in Ubuntu this is orange in color (as shown below) which distracts me:

enter image description here

Any idea on how I can fix this?
Not sure why the colors are different? My Eclipse on Windows 8 and Ubuntu 14.04 are both Kepler 4.3

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

This is called as Range indicator.You can switch off the range indicator.

How:

Click Windows > Preferences. Navigate to General > Editors > Text Editors. De select Show Range indicator option.

How to change the color:

Color of range indicator is controlled by OS not by eclipse.

  • Install gtk-theme-config tool from Ubuntu software centre. Change the Highlight background color. Logout and login again.

enter image description here

  • You can also do this by installing dconf-editor as said here

After change:

enter image description here

Note that this will change the selection colour in other applications also like nautilus, Firefox etc.

How to apply this only to eclipse:

Somewhere on your home directory, create a gtkrc file (like: ~/.gtkrc-eclipse) with following content:

gtk-color-scheme = "selected_bg_color:#0AFC02
selected_fg_color:#FFFFFF
orginal_selected_bg_color:#f07746
tooltip_bg_color:#f5f5c5
tooltip_fg_color:#000000"

style "range-indicator"
{
    base[SELECTED]    = @selected_bg_color
}
class "GtkWindow" style "range-indicator"

Launch eclipse from command line like,

env GTK2_RC_FILES=/usr/share/themes/<Your current theme>/gtk-2.0/gtkrc:/home/<user name>/.gtkrc-eclipse '

env GTK2_RC_FILES=/usr/share/themes/Ambiance/gtk-2.0/gtkrc:/home/chandrayya/.gtkrc-eclipse '/opt/eclipse-3.3/eclipse'

You can find out your current theme by executing,

gsettings get org.gnome.desktop.interface gtk-theme

Note that is also changes the text selection background and foreground colour in editor, we can't avoid it.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...