Bug 484742 - Wrong tooltip colors under KDE
Summary: Wrong tooltip colors under KDE
Status: CLOSED DUPLICATE of bug 500196
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.6   Edit
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-20 18:58 EST by Sergey Prigogin CLA
Modified: 2017-02-28 12:10 EST (History)
3 users (show)

See Also:


Attachments
Tooltip in Eclipse (33.90 KB, image/png)
2015-12-20 18:58 EST, Sergey Prigogin CLA
no flags Details
KDE tooltip color preferences (170.46 KB, image/png)
2015-12-20 19:00 EST, Sergey Prigogin CLA
no flags Details
Java editor "Source hover background" preference (95.86 KB, image/png)
2015-12-22 15:38 EST, Sergey Prigogin CLA
no flags Details
Hover with system colors in the default "Greybird" theme of Xubuntu. Yes it does have a black background. (91.76 KB, image/png)
2016-01-05 12:07 EST, Joachim Durchholz CLA
no flags Details
This is how a hover looks with Greybird's system colors. Notice the @Override and the java.util.HashMap links. (72.70 KB, image/png)
2016-01-05 12:15 EST, Joachim Durchholz CLA
no flags Details
The Javadoc looks the same. System hover background does not even apply. (50.49 KB, image/png)
2016-01-05 12:17 EST, Joachim Durchholz CLA
no flags Details
Here is the same Javadoc using the Adwaita theme. (48.77 KB, image/png)
2016-01-05 12:20 EST, Joachim Durchholz CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Prigogin CLA 2015-12-20 18:58:59 EST
Created attachment 258817 [details]
Tooltip in Eclipse

Ubuntu 14.04.1 LTS
KDE 4.13.3
GTK 3.10.8-0ubuntu1.6

Eclipse tooltip colors, both foreground and background, don't match the preferences set in KDE. The the attachments.
Comment 1 Sergey Prigogin CLA 2015-12-20 19:00:01 EST
Created attachment 258818 [details]
KDE tooltip color preferences
Comment 2 Joachim Durchholz CLA 2015-12-22 06:13:04 EST
Try and verify the tooltip background in some other application.
It's possible that you're seeing just the default settings, and some other configuration is overriding that. (E.g. in XFCE, the tooltip color is governed by the theme but I can override that via the Gnome Color Chooser.)
Comment 3 Sergey Prigogin CLA 2015-12-22 14:20:58 EST
(In reply to Joachim Durchholz from comment #2)

The tooltip appearance is inconsistent between applications. Libre Office and all KDE applications follow the KDE tooltip color preferences. Tooltips in Eclipse, Calculator, GNOME System Monitor and several other applications are white on black regardless of the KDE preferences and the settings in GNOME Color Chooser. Tooltips in GIMP and Chrome are black on gray regardless of the KDE preferences and the settings in GNOME Color Chooser.

Eclipse should behave as Libre Office and follow the KDE color preferences when running under KDE. In addition it should give user an option to either follow the system colors or to override them and to set the tooltip colors in Eclipse.
Comment 4 Joachim Durchholz CLA 2015-12-22 14:50:27 EST
I agree with Sergey for standard tooltips (those on toolbar buttons, view/editor tabs etc.).

For tooltips that use Eclipse's color scheme (e.g. the Javadoc tooltip), Eclipse's color scheme must be used, or it will run into color clashes, such as the unreadable dark-blue-on-black Javadoc tooltip that I uploaded as attachment.
Comment 5 Sergey Prigogin CLA 2015-12-22 15:38:55 EST
Created attachment 258854 [details]
Java editor "Source hover background" preference

There is already the "Source hover background" preference for the Java editor, but this preference is completely ignored. It also doesn't make sense that there is no matching foreground preference since getting background and foreground preferences from independent sources is a recipe for creating unreadable text.

It also doesn't make sense that the preference is defined for the Java editor, but not for Text Editors since even a plain text editor displays hovers.
Comment 6 Dani Megert CLA 2015-12-29 04:31:11 EST
(In reply to Sergey Prigogin from comment #5)
> Created attachment 258854 [details]
> Java editor "Source hover background" preference
> 
> There is already the "Source hover background" preference for the Java
> editor, but this preference is completely ignored. It also doesn't make
> sense that there is no matching foreground preference since getting
> background and foreground preferences from independent sources is a recipe
> for creating unreadable text.
> 
> It also doesn't make sense that the preference is defined for the Java
> editor, but not for Text Editors since even a plain text editor displays
> hovers.

It does make sense. Let me try to explain.

The general rule is that hovers use the following colors from SWT:
  org.eclipse.swt.SWT.COLOR_INFO_BACKGROUND
  org.eclipse.swt.SWT.COLOR_INFO_FOREGROUND
which are set by SWT according to the OS settings.

So far we do not offer preferences in Eclipse for SWT constants taken from the OS, e.g. also no preference for the font used in tables and trees, hence e.g. no Eclipse preference to set the font in most of our views.

For the Java source hover, we wanted to use the same color scheme as in the Java editor for syntax coloring, but we still wanted to keep the standard/OS hover background color. On some OSes this did not work well, hence we allowed to adjust the Source hover background for those cases.
Comment 7 Joachim Durchholz CLA 2015-12-29 04:42:15 EST
Mixing colors from different sources (here: OS for background and syntax highlighting for foreground) does not make sense, because colors interact and hence need to be designed as a whole.
That statement is easy to prove, just look at the provided screenshot.
Comment 8 Joachim Durchholz CLA 2015-12-29 04:48:14 EST
I.e. I do not think Eclipse should get a preference to "apply Eclipse colors to background as well".
It should get a preference to activate or deactivate "Use syntax highlighting (uses Eclipse color scheme) for the XXX hover". Though I suspect that such a preference is mostly noise, since I doubt there's any sense in applying OS colors. Eclipse tooltips are not really the same as OS tooltips; even the HTML support in tooltips is a JDK extension that goes far beyond what e.g. GDI offers.
Comment 9 Dani Megert CLA 2016-01-05 08:40:27 EST
(In reply to Joachim Durchholz from comment #7)
> Mixing colors from different sources (here: OS for background and syntax
> highlighting for foreground) does not make sense, because colors interact
> and hence need to be designed as a whole.
> That statement is easy to prove, just look at the provided screenshot.

I don't get your point. As said, for normal hovers, we do use OS colors for background and foreground and don't offer any preferences. For the Java source hover, we want to use the same colors as in the editor, with the option to change the default tool tip background. If your point is, that we should use the editor background in the Java source hover, then that's one way to do it, but we decided to give the tool tip background higher priority.
Comment 10 Joachim Durchholz CLA 2016-01-05 11:05:23 EST
> If your point is, that we should use the editor background in the
> Java source hover, then that's one way to do it, but we decided to
> give the tool tip background higher priority.

What were the reasons for that decision?
It's hard to discuss relative merits without that.
Comment 11 Dani Megert CLA 2016-01-05 11:33:13 EST
(In reply to Joachim Durchholz from comment #10)
> > If your point is, that we should use the editor background in the
> > Java source hover, then that's one way to do it, but we decided to
> > give the tool tip background higher priority.
> 
> What were the reasons for that decision?
> It's hard to discuss relative merits without that.

That the user perceives this as a hover. On Windows, a hover with a white background, which the editor has, is not looking as expected and not looking good.
Comment 12 Joachim Durchholz CLA 2016-01-05 11:48:09 EST
A hover with syntax coloring and a toolbar at the bottom isn't looking as expected anyway.
Somehow the screenshot upload I referred to earlier didn't make it to the bugzilla; I'll upload a new one, please take a look and tell me if you think that that is looking good.
Comment 13 Joachim Durchholz CLA 2016-01-05 12:07:25 EST
Created attachment 259006 [details]
Hover with system colors in the default "Greybird" theme of Xubuntu. Yes it does have a black background.
Comment 14 Dani Megert CLA 2016-01-05 12:13:37 EST
(In reply to Joachim Durchholz from comment #13)
> Created attachment 259006 [details]
> Hover with system colors in the default "Greybird" theme of Xubuntu. Yes it
> does have a black background.

This is not related to the Java source hover in any way and that's the only one where we (SDK) have separate a preference.
Comment 15 Joachim Durchholz CLA 2016-01-05 12:15:37 EST
Created attachment 259007 [details]
This is how a hover looks with Greybird's system colors. Notice the @Override and the java.util.HashMap links.
Comment 16 Joachim Durchholz CLA 2016-01-05 12:17:35 EST
Created attachment 259008 [details]
The Javadoc looks the same. System hover background does not even apply.
Comment 17 Joachim Durchholz CLA 2016-01-05 12:20:10 EST
Created attachment 259009 [details]
Here is the same Javadoc using the Adwaita theme.
Comment 18 Joachim Durchholz CLA 2016-01-05 12:21:46 EST
Yes it is. The background color changes with the system preference color.
This might be a bug in Javadoc rendering actually.
Comment 19 Joachim Durchholz CLA 2016-01-05 12:29:32 EST
I think the "Java editor" aspect got mixed up a bit.
The issue is the Javadoc hover's background color in the Java editor.
Not about a hover using the Java editor's background; that would make sense only for hovers that display Java source, not for rendered Javadoc displays.
Comment 20 Dani Megert CLA 2016-01-05 14:10:32 EST
(In reply to Joachim Durchholz from comment #19)
> I think the "Java editor" aspect got mixed up a bit.
> The issue is the Javadoc hover's background color in the Java editor.

Right, this (comment 0) is about not picking up the color from the OS (theme), and for sure we want to fix that.
Comment 21 Lars Vogel CLA 2016-04-20 12:18:15 EDT
Mass move to 4.7 as M7 is approaching. Please move back in case you are planning to fix it for Neon.
Comment 22 Lars Vogel CLA 2016-12-06 13:30:56 EST
Marking as dup of Bug 500196 (which handles the Javadoc colors). Leo has other bug for the other color inconsistencies.

*** This bug has been marked as a duplicate of bug 500196 ***