diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java index a8868ff67f6..b1b30da2454 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKGraphicsUtils.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,16 +49,18 @@ class GTKGraphicsUtils extends SynthGraphicsUtils { int componentState = context.getComponentState(); if ((componentState & SynthConstants.DISABLED) == SynthConstants.DISABLED){ - Color orgColor = g.getColor(); - g.setColor(context.getStyle().getColor(context, - GTKColorType.WHITE)); - x += 1; - y += 1; - super.paintText(context, g, text, x, y, mnemonicIndex); + 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; + g.setColor(orgColor); + x -= 1; + y -= 1; + } super.paintText(context, g, text, x, y, mnemonicIndex); } else { diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKIconFactory.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKIconFactory.java index f19ac21e14d..46f8d3ff189 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKIconFactory.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKIconFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -214,6 +214,18 @@ class GTKIconFactory { Region region = context.getRegion(); GTKStyle style = (GTKStyle) context.getStyle(); + if (GTKLookAndFeel.is3() && region == Region.MENU) { + Object value = style.getClassSpecificValue("arrow-scaling"); + if (value instanceof Number) { + iconDimension = (int)(((Number) value).floatValue() * + (style.getFont(context).getSize2D() + + 2 * style.getClassSpecificIntValue(context, + "indicator-spacing", DEFAULT_ICON_SPACING))); + if (iconDimension > 0) { + return iconDimension; + } + } + } iconDimension = style.getClassSpecificIntValue(context, "indicator-size", (region == Region.CHECK_BOX_MENU_ITEM || diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java index 56ec905ba33..94408916d8f 100644 --- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java +++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKPainter.java @@ -649,10 +649,19 @@ class GTKPainter extends SynthPainter { y += insets.top; if (orientation == JSeparator.HORIZONTAL) { w -= (insets.left + insets.right); - detail = "hseparator"; } else { h -= (insets.top + insets.bottom); - detail = "vseparator"; + } + if (GTKLookAndFeel.is3()) { + if (id == Region.POPUP_MENU_SEPARATOR) { + detail = "menuitem"; + h -= (insets.top + insets.bottom); + } else { + detail = "separator"; + } + } else { + detail = orientation == JSeparator.HORIZONTAL ? + "hseparator" : "vseparator"; } synchronized (UNIXToolkit.GTK_LOCK) { if (! ENGINE.paintCachedImage(g, x, y, w, h, id, state, @@ -1381,8 +1390,13 @@ class GTKPainter extends SynthPainter { if (gtkState == SynthConstants.MOUSE_OVER) { shadow = ShadowType.IN; } + if (!GTKLookAndFeel.is3()) { + x += 3; + y += 3; + w = h = 7; + } ENGINE.paintArrow(g, context, Region.MENU_ITEM, gtkState, shadow, - dir, "menuitem", x + 3, y + 3, 7, 7); + dir, "menuitem", x, y, w, h); } public void paintCheckBoxMenuItemCheckIcon(SynthContext context,