Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 398748

Summary: [GTK3] Text in Javadoc hover unreadable on Ubuntu 12.04
Product: [Eclipse Project] Platform Reporter: Arun Thondapu <arunkumar.thondapu>
Component: SWTAssignee: Silenio Quarti <Silenio_Quarti>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: akurtakov, gheorghe, Silenio_Quarti
Version: 4.3   
Target Milestone: 4.3 M7   
Hardware: PC   
OS: Linux-GTK   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=543027
Whiteboard:
Bug Depends on:    
Bug Blocks: 340067    
Attachments:
Description Flags
Invisible/Unreadable text in widgets none

Description Arun Thondapu CLA 2013-01-22 09:26:35 EST
Created attachment 225940 [details]
Invisible/Unreadable text in widgets

The Javadoc view that appears on mouse hover in the editor uses colors that make it difficult to read when using Eclipse on Ubuntu 12.04. The same problem is seen when the chevron is used to switch editor tabs (white foreground color is used for text on white background color making the text invisible, see attached screenshot).

This problem is not seen on Fedora 17.
Comment 1 Arun Thondapu CLA 2013-01-22 09:43:11 EST
This is more of a problem with the GTK theme color settings than Eclipse itself which just uses the colors from the theme settings. That is the reason the problem is not seen on Fedora 17 (which uses default GTK theme Adwaita as opposed to Ambiance on Ubuntu 12.04).

An easy workaround on Ubuntu is to edit the colors used by the default theme for tooltips manually, in the following files

/usr/share/themes/Ambiance/gtk-3.0/settings.ini
/usr/share/themes/Ambiance/gtk-3.0/gtk.css
/usr/share/themes/Ambiance/gtk-2.0/gtkrc

Detailed steps are available here - http://askubuntu.com/questions/70599/how-to-change-tooltip-background-color-in-unity
Comment 2 Robert Munteanu CLA 2013-01-22 10:23:49 EST
See also bug #393340 , but his is not about the GTK3 port . The root cause may be similar though.
Comment 3 Alexander Kurtakov CLA 2013-03-21 12:13:25 EDT
There have been recent fixed to gnome-theme-standard that fixed the problem on Fedora 18. Can you try/verify this?
Comment 4 Silenio Quarti CLA 2013-03-26 16:00:30 EDT
The problem on Ubuntu 12.04 with the Ambiance theme happens because the style sheet defines the background of the tooltip class as follows:

-------------------
...
.tooltip {
    background-image: -gtk-gradient (radial, center 0, 0, center 0, 0.8,
                from (alpha (mix (@tooltip_bg_color, #ffffff, 0.2), 0.86)),
                          to (alpha (@tooltip_bg_color, 0.86)));
...
------------------

Our code in Display.initializeSystemColors() tries to get the background-color from the context which is not set in this case (only the background-image is set). The COLOR_INFO_BACKGROUND should be black instead of lightgray.
Comment 5 Silenio Quarti CLA 2013-04-03 10:15:06 EDT
Fixed by these changes. The background (black) is calculated by drawing the tooltip background on a off screen image and taking the middle pixel. This is not completely right, but I see no alternative. And the context need to be invalidate after adding the tooltip class in order to get the right foreground (white).

http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=4050c833656a0fc5cbbf9b90229349498d472ae9

http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=d8e12db9b88dc96dbe41cc1c8e60f7059a2e208b