Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoland Grunberg2018-03-01 14:52:26 -0500
committerAlexander Kurtakov2018-03-20 14:49:23 -0400
commit58b22c85cd2380c638d64ef290f6b7b80785c892 (patch)
treec9122bf2a354611d54a574e898ce67b35d6cd25f /org.eclipse.jface.text/src
parent6b6a803be8b3cee91b11f0494bbee7b35bb5e4bf (diff)
downloadeclipse.platform.text-58b22c85cd2380c638d64ef290f6b7b80785c892.tar.gz
eclipse.platform.text-58b22c85cd2380c638d64ef290f6b7b80785c892.tar.xz
eclipse.platform.text-58b22c85cd2380c638d64ef290f6b7b80785c892.zip
Bug 531761: Value suggestion popup has black background on light theme.I20180320-2000
Change-Id: I8692ccb8e97855115a72692abcb5c51a8eaccb80 Signed-off-by: Roland Grunberg <rgrunber@redhat.com>
Diffstat (limited to 'org.eclipse.jface.text/src')
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/CompletionProposalPopup2.java21
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java17
2 files changed, 28 insertions, 10 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/CompletionProposalPopup2.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/CompletionProposalPopup2.java
index 8e39c1391..2355def61 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/CompletionProposalPopup2.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/link/contentassist/CompletionProposalPopup2.java
@@ -31,11 +31,15 @@ import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.jface.internal.text.TableOwnerDrawSupport;
+import org.eclipse.jface.preference.JFacePreferences;
+import org.eclipse.jface.resource.ColorRegistry;
+import org.eclipse.jface.resource.JFaceColors;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.StyledString;
@@ -311,13 +315,20 @@ class CompletionProposalPopup2 implements IContentAssistListener2 {
});
}
- fProposalShell.setBackground(control.getDisplay().getSystemColor(SWT.COLOR_BLACK));
+ ColorRegistry colorRegistry= JFaceResources.getColorRegistry();
+ Color background= colorRegistry.get(JFacePreferences.CONTENT_ASSIST_BACKGROUND_COLOR);
+ if (background == null) {
+ background= JFaceColors.getInformationViewerBackgroundColor(Display.getDefault());
+ }
- Color c= control.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND);
- fProposalTable.setBackground(c);
+ Color foreground= colorRegistry.get(JFacePreferences.CONTENT_ASSIST_FOREGROUND_COLOR);
+ if (foreground == null) {
+ foreground= JFaceColors.getInformationViewerBackgroundColor(Display.getDefault());
+ }
- c= control.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND);
- fProposalTable.setForeground(c);
+ fProposalShell.setBackground(background);
+ fProposalTable.setBackground(background);
+ fProposalTable.setForeground(foreground);
fProposalTable.addSelectionListener(new SelectionListener() {
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
index 93fa19be1..92052d43d 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/contentassist/CompletionProposalPopup.java
@@ -75,6 +75,7 @@ import org.eclipse.jface.contentassist.IContentAssistSubjectControl;
import org.eclipse.jface.internal.text.InformationControlReplacer;
import org.eclipse.jface.internal.text.TableOwnerDrawSupport;
import org.eclipse.jface.preference.JFacePreferences;
+import org.eclipse.jface.resource.JFaceColors;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.util.Geometry;
import org.eclipse.jface.viewers.StyledString;
@@ -654,13 +655,19 @@ class CompletionProposalPopup implements IContentAssistListener {
}
});
- fProposalShell.setBackground(control.getDisplay().getSystemColor(SWT.COLOR_GRAY));
+ Color background= getBackgroundColor(control);
+ if (background == null) {
+ background= JFaceColors.getInformationViewerBackgroundColor(Display.getDefault());
+ }
- Color c= getBackgroundColor(control);
- fProposalTable.setBackground(c);
+ Color foreground= getForegroundColor(control);
+ if (foreground == null) {
+ foreground= JFaceColors.getInformationViewerBackgroundColor(Display.getDefault());
+ }
- c= getForegroundColor(control);
- fProposalTable.setForeground(c);
+ fProposalShell.setBackground(background);
+ fProposalTable.setBackground(background);
+ fProposalTable.setForeground(foreground);
fProposalTable.addSelectionListener(new SelectionListener() {

Back to the top