# HG changeset patch # User prr # Date 1510614258 28800 # Node ID d4ed3b8d166cea4b5f298ce9fa903c12b461bae5 # Parent 845872abef5583cd3045c62ecf007e0cdc68ea00 8191041: Questionable Rendering of Disabled Text in Swing GTK L&F Reviewed-by: prr, ssadetsky Contributed-by: Michael D diff -r 845872abef55 -r d4ed3b8d166c src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java --- 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); + + String themeName = GTKLookAndFeel.getGtkThemeName(); + if (themeName != null && themeName.startsWith("blueprint") && + shouldShadowText(context.getRegion(), componentState)) { - g.setColor(orgColor); - x -= 1; - y -= 1; - } - super.paintText(context, g, text, x, y, mnemonicIndex); + 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); } /**