I changed this patch since this one is slightly more intuitive.
2005-08-05 Lillian Angel <[EMAIL PROTECTED]>
* javax/swing/plaf/basic/BasicGraphicsUtils.java
(getPreferredButtonSize): Added horizontalAdjustment to width
to create gap at end of label text.
* javax/swing/plaf/basic/BasicMenuItemUI.java
(getPreferredSize): Removed "*2" since fix was moved to
BasicGraphicsUtils
On Thu, 2005-08-04 at 15:46 -0400, Lillian Angel wrote:
> 2005-08-04 Lillian Angel <[EMAIL PROTECTED]>
>
> * javax/swing/plaf/basic/BasicMenuItemUI.java
> (getPreferredSize): Multiplied defaultTextIconGap by 2,
> so there is equal space around the MenuItem
>
>
> I accidently committed my changes before making a patch, basically here
> is the code i changed:
>
> Original-----
> public Dimension getPreferredSize(JComponent c)
> {
> return getPreferredMenuItemSize(c, checkIcon, arrowIcon,
> defaultTextIconGap);
> }
>
> Modified------
> public Dimension getPreferredSize(JComponent c)
> {
> return getPreferredMenuItemSize(c, checkIcon, arrowIcon,
> defaultTextIconGap*2);
> }
>
>
>
> _______________________________________________
> Classpath-patches mailing list
> [email protected]
> http://lists.gnu.org/mailman/listinfo/classpath-patches
Index: javax/swing/plaf/basic/BasicGraphicsUtils.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicGraphicsUtils.java,v
retrieving revision 1.15
diff -u -r1.15 BasicGraphicsUtils.java
--- javax/swing/plaf/basic/BasicGraphicsUtils.java 8 Jul 2005 15:24:08 -0000 1.15
+++ javax/swing/plaf/basic/BasicGraphicsUtils.java 5 Aug 2005 12:22:55 -0000
@@ -609,7 +609,7 @@
* LineMetrics, not a FontMetrics argument. But fixing this that
* would change the public API.
*/
- SwingUtilities.layoutCompoundLabel(
+ SwingUtilities.layoutCompoundLabel(
b, // for the component orientation
b.getToolkit().getFontMetrics(b.getFont()), // see comment above
b.getText(),
@@ -630,10 +630,10 @@
*/
contentRect = textRect.union(iconRect);
-
+
return new Dimension(insets.left
+ contentRect.width
- + insets.right,
+ + insets.right + b.getHorizontalAlignment(),
insets.top
+ contentRect.height
+ insets.bottom);
Index: javax/swing/plaf/basic/BasicMenuItemUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicMenuItemUI.java,v
retrieving revision 1.18
diff -u -r1.18 BasicMenuItemUI.java
--- javax/swing/plaf/basic/BasicMenuItemUI.java 4 Aug 2005 19:45:02 -0000 1.18
+++ javax/swing/plaf/basic/BasicMenuItemUI.java 5 Aug 2005 12:22:56 -0000
@@ -356,7 +356,7 @@
public Dimension getPreferredSize(JComponent c)
{
return getPreferredMenuItemSize(c, checkIcon, arrowIcon,
- defaultTextIconGap*2);
+ defaultTextIconGap);
}
protected String getPropertyPrefix()
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches