Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Ufimtsev2017-04-25 18:32:11 +0000
committerLeo Ufimtsev2017-04-25 18:32:11 +0000
commit37f745df9c27a27a7ad4778468f9193e6f7b7e78 (patch)
treec341bdcb24756ab39daaca30d2396133b2154f5e
parenta1d67d4a81f1e3edd9e4ba5967ea9fe2b20fd7c3 (diff)
downloadeclipse.platform.text-37f745df9c27a27a7ad4778468f9193e6f7b7e78.tar.gz
eclipse.platform.text-37f745df9c27a27a7ad4778468f9193e6f7b7e78.tar.xz
eclipse.platform.text-37f745df9c27a27a7ad4778468f9193e6f7b7e78.zip
Bug 507073: [content assist] Use fitting colors for Content assist'sI20170425-2000
additional info pane Part 1: HTMLPrinter should use default JFace colours suitable for presenting information rather than that of tooltips (INFO_*). The reason is on Gtk, tooltips have black background and white text, making it hard to read information. (See screenshot in bug). This makes Code-completion's javadoc window have suitable colours on gtk again (See screen shot in bug). On Windows/Cocoa, there is no change in behaviour. This is Gtk specific. Test (gtk): - Launch child Eclipse - Type "Obj", then ctrl+space (keep pressing ctrl+space till "Object" appears as an option) - Inspect javadoc popup. Before: Black background/white text After: White background/black text: NOTE: - This may make some darktheme elements appear white-ish in some cases. Part 2 (see bug) addresses the case for the javadoc info additional plane on Dark theme. For other elements, similar strategies should be used to call HTMLPrinter with colours suitable for darktheme. Change-Id: I8b11d1db9c472693d1322f7a714e0a4e60650c95 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=507073 Signed-off-by: Leo Ufimtsev <lufimtse@redhat.com>
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTMLPrinter.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTMLPrinter.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTMLPrinter.java
index 57ee85a7f..27498faad 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTMLPrinter.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTMLPrinter.java
@@ -22,6 +22,7 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
+import org.eclipse.jface.resource.JFaceColors;
import org.eclipse.jface.util.Util;
import org.eclipse.jface.text.DefaultInformationControl;
@@ -65,8 +66,8 @@ public class HTMLPrinter {
}
private static void cacheColors(Display display) {
- BG_COLOR_RGB= display.getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB();
- FG_COLOR_RGB= display.getSystemColor(SWT.COLOR_INFO_FOREGROUND).getRGB();
+ BG_COLOR_RGB= JFaceColors.getInformationViewerBackgroundColor(display).getRGB();
+ FG_COLOR_RGB= JFaceColors.getInformationViewerForegroundColor(display).getRGB();
}
private static void installColorUpdater(final Display display) {

Back to the top