diff options
author | Eric Williams | 2016-04-14 15:28:31 +0000 |
---|---|---|
committer | Eric Williams | 2016-04-20 13:36:29 +0000 |
commit | 6e1a1963bfd1889610ca6febb140cbcf91940f98 (patch) | |
tree | e79631d567747ec9430cae0aa2ee80019907ca53 | |
parent | 4344fe3d6bc69a8722f98632b3ad0c8cf1894bc3 (diff) | |
download | eclipse.platform.swt-6e1a1963bfd1889610ca6febb140cbcf91940f98.tar.gz eclipse.platform.swt-6e1a1963bfd1889610ca6febb140cbcf91940f98.tar.xz eclipse.platform.swt-6e1a1963bfd1889610ca6febb140cbcf91940f98.zip |
Bug 491327: Quick Outline search field text unreadable (white on white)
This patch fixes up background color problems for SWT.SINGLE Text
widgets (entries). The fix is to simply allow earlier versions of GTK to
set their background colors using CSS as well.
Tested on GTK3.20, 3,18, 3.16, and 3.14. GTK2 behavior is unaffected, no
additional AllNonBrowser JUnit test failures on either GTK3 or GTK2.
Change-Id: Ic49ead6d2822526cde27b2946c9d2b9291c86c2b
Signed-off-by: Eric Williams <ericwill@redhat.com>
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java index b3e9902ebe..371e421ddd 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Text.java @@ -2179,7 +2179,7 @@ void setBackgroundColor (GdkColor color) { @Override GdkColor getContextBackground () { - if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) { + if (OS.GTK3) { if (background != null) { return display.toGdkColor (background); } else { @@ -2205,7 +2205,7 @@ void setBackgroundColor (long /*int*/ context, long /*int*/ handle, GdkRGBA rgba } GdkColor defaultColor = getDisplay().COLOR_LIST_SELECTION; GdkRGBA selectedBackground = display.toGdkRGBA (defaultColor); - if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) { + if (OS.GTK3) { String css; if (OS.GTK_VERSION >= OS.VERSION(3, 20, 0)) { if ((style & SWT.SINGLE) != 0) { @@ -2228,9 +2228,6 @@ void setBackgroundColor (long /*int*/ context, long /*int*/ handle, GdkRGBA rgba // Apply background color and any foreground color String finalCss = display.gtk_css_create_css_color_string (cssBackground, cssForeground, SWT.BACKGROUND); gtk_css_provider_load_from_css(context, finalCss); - } else { - super.setBackgroundColor(context, handle, rgba); - OS.gtk_widget_override_background_color(handle, OS.GTK_STATE_FLAG_SELECTED, selectedBackground); } } |