[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cp-patches] Patch for Approval: BorderLayout fixes JMenu strange si
From: |
Robert Schuster |
Subject: |
Re: [cp-patches] Patch for Approval: BorderLayout fixes JMenu strange size reduction. |
Date: |
Wed, 20 Jul 2005 20:00:15 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.7.8) Gecko/20050514 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi,
this fixes it quite nice.
Btw: The text in the JMenuItem could have some more space on the right side.
Currently it looks like this:
| Bla|
| Foo|
| Baz|
I would expect something like
| Bla |
| Foo |
| Baz |
Or should I file a separate bug for this?
cu
Robert
Anthony Balkissoon wrote:
> This patch fixes the strange size reduction seen in Robert Schuster's
> license chooser program and reported to bug-classpath.
>
> This patch essentially removes the horizontal and vertical padding of
> components when there is no adjacent component. The problem involved
> JRootPane being resized everytime its JLayeredPane was resized: the
> JLayeredPane would be set to the full size of the JRootPane only to have
> the JRootPane be reduced in size due to this padding issue.
>
> This patch needs approval, especially since it involves an AWT layout
> manager rather than my normal swing widgets.
>
> Patch is attached.
>
> 2005-07-20 Anthony Balkissoon <address@hidden>
>
> * java/awt/BorderLayout.java:
> (layoutContainer): Removed addition of horizontal and vertical gaps
> when there is no corresponding adjacent component.
>
>
> ------------------------------------------------------------------------
>
> Index: java/awt/BorderLayout.java
> ===================================================================
> RCS file: /cvsroot/classpath/classpath/java/awt/BorderLayout.java,v
> retrieving revision 1.15
> diff -u -r1.15 BorderLayout.java
> --- java/awt/BorderLayout.java 2 Jul 2005 20:32:23 -0000 1.15
> +++ java/awt/BorderLayout.java 20 Jul 2005 15:02:21 -0000
> @@ -591,25 +591,25 @@
> */
>
> int x1 = i.left;
> - int x2 = x1 + w.width + hgap;
> + int x2 = x1 + w.width + (w.width == 0 ? 0 : hgap);
> int x3;
> if (t.width <= i.right + e.width)
> - x3 = x2 + w.width + hgap;
> + x3 = x2 + w.width + (w.width == 0 ? 0 : hgap);
> else
> x3 = t.width - i.right - e.width;
> int ww = t.width - i.right - i.left;
>
> int y1 = i.top;
> - int y2 = y1 + n.height + vgap;
> + int y2 = y1 + n.height + (n.height == 0 ? 0 : vgap);
> int midh = Math.max(e.height, Math.max(w.height, c.height));
> int y3;
> if (t.height <= i.bottom + s.height)
> y3 = y2 + midh + vgap;
> else
> y3 = t.height - i.bottom - s.height;
> - int hh = y3-y2-vgap;
> + int hh = y3-y2-(s.height == 0 ? 0 : vgap);
>
> - setBounds(center, x2, y2, x3-x2-hgap, hh);
> + setBounds(center, x2, y2, x3-x2-(w.width == 0 ? 0 : hgap), hh);
> setBounds(my_north, x1, y1, ww, n.height);
> setBounds(my_south, x1, y3, ww, s.height);
> setBounds(my_west, x1, y2, w.width, hh);
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Classpath-patches mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/classpath-patches
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFC3pEvG9cfwmwwEtoRAlQmAJ4yyIJJr/C6dhAH14dlEkexZC06CwCgkCin
Hs+P8uPgsLdxNebB0XM23u4=
=yR+1
-----END PGP SIGNATURE-----