> I think the menu item layout may be relying on the white space in the old
> icon, so
> the new positioning may not be entirely correct yet, but (for me at least)
> the menus
> look better now. Maybe someone (Roman/Lillian?) who knows the menu UI code
> better
> than I do could check that...
I fixed the positioning of the arrow icon. The gap was previously too
small between the text and the icon.
2005-09-29 Lillian Angel <[EMAIL PROTECTED]>
* javax/swing/plaf/basic/BasicMenuItemUI.java:
Added a new field for the gap between the icon and text.
(setPreferredMenuItemSize): Changed gap from defaultTextIconGap
to defaultTextArrowIconGap.
Index: javax/swing/plaf/basic/BasicMenuItemUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicMenuItemUI.java,v
retrieving revision 1.26
diff -u -r1.26 BasicMenuItemUI.java
--- javax/swing/plaf/basic/BasicMenuItemUI.java 29 Sep 2005 08:53:11 -0000 1.26
+++ javax/swing/plaf/basic/BasicMenuItemUI.java 29 Sep 2005 16:35:50 -0000
@@ -109,7 +109,7 @@
* Number of spaces between icon and text.
*/
protected int defaultTextIconGap = 4;
-
+
/**
* Color of the text when menu item is disabled
*/
@@ -166,6 +166,11 @@
private int defaultAcceleratorLabelGap = 10;
/**
+ * Number of spaces between the text and the arrow icon.
+ */
+ private int defaultTextArrowIconGap = 10;
+
+ /**
* Creates a new BasicMenuItemUI object.
*/
public BasicMenuItemUI()
@@ -342,7 +347,7 @@
if (arrowIcon != null && (c instanceof JMenu))
{
- d.width = d.width + arrowIcon.getIconWidth() + defaultTextIconGap;
+ d.width = d.width + arrowIcon.getIconWidth() + defaultTextArrowIconGap;
if (arrowIcon.getIconHeight() > d.height)
d.height = arrowIcon.getIconHeight();
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches