Change GTK3 tooltip color only for Eclipse running in Ubuntu

半城伤御伤魂 提交于 2019-12-13 07:17:22

问题


I am running Eclipse Mars on Ubuntu 15.04. I have seen instructions to change GTK3 tooltip fg/bg color at system-wide level. My question is how can I change the GTK3 tooltip fg/bg color only for Eclipse without affecting other applications.

(GTK3 and CSS are not my fields of expertise so I really need some help here)


回答1:


I found a way to fix Eclipse tooltip color without falling back to GTK2 and without affecting any other application.

The fix is captured in a script and it can be accessed here.

https://github.com/KiranMohan/eclipse-gtk3-ubuntu

The script makes a copy of the Ambiance theme, modifies the tooltip color and then writes a launcher for eclipse with this new Theme.




回答2:


How to apply GTK changes 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\nselected_fg_color:#FFFFFF\norginal_selected_bg_color:#f07746\ntooltip_bg_color:#f5f5c5\ntooltip_fg_color:#000000"

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

Choose your fg/bg color code.

Also refer this post Change Eclipse sidebar vertical scope highlighting.



来源:https://stackoverflow.com/questions/32920268/change-gtk3-tooltip-color-only-for-eclipse-running-in-ubuntu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!