From a1d67d4a81f1e3edd9e4ba5967ea9fe2b20fd7c3 Mon Sep 17 00:00:00 2001 From: Leo Ufimtsev Date: Mon, 24 Apr 2017 17:01:28 -0400 Subject: Bug 507062 - Fix black strip of color in JavaDocHover (patch 2) Use information colors api in JFaceColor instead of those in workbench. This makes the Javadoc dialogue's strip at the bottom have the same consistent color with all other dialogues in eclipse. (e.g same as in code completion in ctrl+space). See screenshot 'patch 2' in bug report. Tests: - Gtk: Javadoc hover, strip at the bottom looks like regular part of Eclipse. - Looks consistent on Dark and Light theme. - Win/Cocoa: Javadoc hover, strip at the bottom looks same as before. Note: The previous patch introduced ability to customize colour of this strip at the bottom. But this made it inconsistent with other eclipse dialogues like code-completion etc. This patch reverts customization in favour of keeping things simple and working. Patchset 4: - Removed null check as api never returns null. Change-Id: Ia6ebf0066b6f241675b2bcbac4c29824270f3415 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=507062 Signed-off-by: Leo Ufimtsev --- .../org/eclipse/jface/text/AbstractInformationControl.java | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/AbstractInformationControl.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/AbstractInformationControl.java index 320932d273e..2a9a5b05714 100644 --- a/org.eclipse.jface.text/src/org/eclipse/jface/text/AbstractInformationControl.java +++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/AbstractInformationControl.java @@ -45,7 +45,7 @@ import org.eclipse.core.runtime.ListenerList; import org.eclipse.jface.action.ToolBarManager; import org.eclipse.jface.internal.text.revisions.Colors; -import org.eclipse.jface.resource.ColorRegistry; +import org.eclipse.jface.resource.JFaceColors; import org.eclipse.jface.resource.JFaceResources; import org.eclipse.jface.util.Geometry; @@ -183,15 +183,8 @@ public abstract class AbstractInformationControl implements IInformationControl, fShell= new Shell(parentShell, shellStyle); Display display= fShell.getDisplay(); - ColorRegistry colorRegistry = JFaceResources.getColorRegistry(); - Color foreground= colorRegistry.get("org.eclipse.ui.workbench.HOVER_FOREGROUND"); //$NON-NLS-1$ - if (foreground == null) { - foreground = display.getSystemColor(SWT.COLOR_INFO_FOREGROUND); - } - Color background= colorRegistry.get("org.eclipse.ui.workbench.HOVER_BACKGROUND"); //$NON-NLS-1$ - if (background == null) { - background = display.getSystemColor(SWT.COLOR_INFO_BACKGROUND); - } + Color foreground= JFaceColors.getInformationViewerForegroundColor(display); + Color background= JFaceColors.getInformationViewerBackgroundColor(display); setColor(fShell, foreground, background); GridLayout layout= new GridLayout(1, false); -- cgit v1.2.3