From 592d29b2d91e140852d4120c2dafd39589e57883 Mon Sep 17 00:00:00 2001 From: Silenio Quarti Date: Thu, 15 Nov 2012 15:08:32 -0500 Subject: Bug 393723 - [GTK3] wrong foreground in Eclipse editor area unselected tabs --- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java index 6d17246bde..99345bbb7d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java @@ -612,6 +612,17 @@ void checkBackground () { } while (true); } +void checkForeground () { + /* + * Feature in GTK 3. The widget foreground is inherited from the immediate + * parent. This is not the expected behavior for SWT. The fix is to avoid + * the inheritance by explicitly setting the default foreground on the widget. + */ + if (OS.GTK3) { + setForegroundColor (topHandle (), display.COLOR_WIDGET_FOREGROUND); + } +} + void checkBorder () { if (getBorderWidth () == 0) style &= ~SWT.BORDER; } @@ -629,6 +640,7 @@ void createWidget (int index) { checkOrientation (parent); super.createWidget (index); checkBackground (); + checkForeground (); if ((state & PARENT_BACKGROUND) != 0) setParentBackground (); checkBuffered (); showWidget (); -- cgit