6857360: NimbusLAF: Menu indicator looks ugly with RTL orientation.
Reviewed-by: rupashka
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusIcon.java Fri Jul 17 15:25:51 2009 +0400
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/NimbusIcon.java Mon Jul 20 13:33:09 2009 +0400
@@ -84,6 +84,8 @@
translatex = 1;
}
}
+ } else if (c instanceof JMenu) {
+ flip = ! c.getComponentOrientation().isLeftToRight();
}
if (g instanceof Graphics2D){
Graphics2D gfx = (Graphics2D)g;
--- a/jdk/src/share/classes/sun/swing/MenuItemLayoutHelper.java Fri Jul 17 15:25:51 2009 +0400
+++ b/jdk/src/share/classes/sun/swing/MenuItemLayoutHelper.java Mon Jul 20 13:33:09 2009 +0400
@@ -718,10 +718,10 @@
}
private void alignRect(Rectangle rect, int alignment, int origWidth) {
- if (alignment != SwingUtilities.LEFT) {
+ if (alignment == SwingConstants.RIGHT) {
rect.x = rect.x + rect.width - origWidth;
- rect.width = origWidth;
}
+ rect.width = origWidth;
}
protected void layoutIconAndTextInLabelRect(LayoutResult lr) {