View Full Version : [FIXED] BorderLayout north and south regions wrong when using percentages

2 May 2008, 5:38 AM
I have a strange behaviour of the BorderLayout when using percentages:

When I resize the Browser, the north and south panels resize depending of the width of the browser window (instead of it's height).

The following line calculates the size of the region in BorderLayout.java:

float s = data.size < 1 ? data.size * rect.width : data.size;Souldn't the rect.height be used?

2 May 2008, 10:50 AM
Good catch. The fix is in SVN.

2 May 2008, 12:23 PM
BorderLayout does not size elements without specifying the size in pixels or percentages. Can the code be updated to use the child element's actual size as well? The can be done by setting the BorderLayoutData.size to 0 and interpreting it in the BorderLayout.onLayout method.
One typical use case can be an application that looks like the MyGWT explorer - multiple sections with the header on the top. Explorer's code sets the absolute size of the header in pixels, which is not a right thing to do, I believe.