changeset 47907:d4ed3b8d166c

8191041: Questionable Rendering of Disabled Text in Swing GTK L&F Reviewed-by: prr, ssadetsky Contributed-by: Michael D <me@md-5.net>
author prr
date Mon, 13 Nov 2017 15:04:18 -0800
parents 845872abef55
children dde53d789c3d
files src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java
diffstat 1 files changed, 8 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java	Mon Nov 13 13:18:35 2017 -0800
+++ b/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java	Mon Nov 13 15:04:18 2017 -0800
@@ -47,34 +47,17 @@
             return;
         }
         int componentState = context.getComponentState();
-        if ((componentState & SynthConstants.DISABLED) ==
-                              SynthConstants.DISABLED){
-            if (!GTKLookAndFeel.is3()) {
-                Color orgColor = g.getColor();
-                g.setColor(context.getStyle().getColor(context,
-                        GTKColorType.WHITE));
-                x += 1;
-                y += 1;
-                super.paintText(context, g, text, x, y, mnemonicIndex);
 
-                g.setColor(orgColor);
-                x -= 1;
-                y -= 1;
-            }
-            super.paintText(context, g, text, x, y, mnemonicIndex);
+        String themeName = GTKLookAndFeel.getGtkThemeName();
+        if (themeName != null && themeName.startsWith("blueprint") &&
+            shouldShadowText(context.getRegion(), componentState)) {
+
+            g.setColor(Color.BLACK);
+            super.paintText(context, g, text, x+1, y+1, mnemonicIndex);
+            g.setColor(Color.WHITE);
         }
-        else {
-            String themeName = GTKLookAndFeel.getGtkThemeName();
-            if (themeName != null && themeName.startsWith("blueprint") &&
-                shouldShadowText(context.getRegion(), componentState)) {
 
-                g.setColor(Color.BLACK);
-                super.paintText(context, g, text, x+1, y+1, mnemonicIndex);
-                g.setColor(Color.WHITE);
-            }
-
-            super.paintText(context, g, text, x, y, mnemonicIndex);
-        }
+        super.paintText(context, g, text, x, y, mnemonicIndex);
     }
 
     /**