Bug 264829 - Add GridLayout.makeRowsEqualHeight
Summary: Add GridLayout.makeRowsEqualHeight
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-13 06:53 EST by Markus Keller CLA
Modified: 2021-11-12 11:43 EST (History)
4 users (show)

See Also:


Attachments
Screenshot with red rectangles to show differing gap sizes (5.53 KB, image/png)
2010-01-13 12:39 EST, Markus Keller CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2009-02-13 06:53:07 EST
N20090212-2000

Add another setting to GridLayout, analogous to makeColumnsEqualWidth:

	/**
	 * makeRowsEqualHeight specifies whether all rows in the layout
	 * will be forced to have the same height.
	 *
	 * The default value is false.
	 */
	public boolean makeRowsEqualHeight = false;

This would for example be useful for layouts like in the New Java Project wizard, where we have a grid of radio buttons that must live in the same composite, and we would like to enforce equal vertical spacing between the radios.
Comment 1 Markus Keller CLA 2010-01-13 12:39:42 EST
Created attachment 156017 [details]
Screenshot with red rectangles to show differing gap sizes

The Apply Patch wizard has the same problem.
Comment 2 Carolyn MacLeod CLA 2010-01-13 13:28:46 EST
This might be a good idea for some day but for now you might consider using a vertical FillLayout or a vertical RowLayout. You can play with the spacing and margins in each of those layouts. Please let me know if this suits your needs (and if not, please say why you need this behavior in GridLayout).
Comment 3 Markus Keller CLA 2010-01-13 14:39:35 EST
The problem in both cases I mentioned is that we need to lay out radio buttons that belong to a single button group. This only works if all the radios have the same parent composite (otherwise, we would have to implement all traverse listeners and selection event handling by hand).

FillLayout and RowLayout don't allow us to add more items to the right of the radio buttons, so nested composites for the horizontal distribution won't work (and they also wouldn't support columns and would need manual handling of traversal).
Comment 4 Carolyn MacLeod CLA 2010-01-14 18:27:33 EST
The snapshot in comment 1 looks ok - are the red-bordered items "fillers"?
If you can keep working around the problem for now, in the way you seem to have already done, then we would like to leave this as an enhancement (i.e. lower priority) until we have some more time.

Would you like to try submitting a patch to GridLayout? I don't think it's a difficult fix... but it would need lots of testing to make sure nobody is broken (lots of people use GridLayout <grin>).
Comment 5 Markus Keller CLA 2010-01-15 05:04:50 EST
> The snapshot in comment 1 looks ok - are the red-bordered items "fillers"?

I've painted these red rectangles on top of the original screenshot. They all have the same size, and if you look closely at the gap between File and URL, you can see that there are a few more pixels between those two radios (in comparison to the top and bottom gaps).

The "workaround" we use now is to use GridLayout and accept the slightly irregular gaps.

I'm sorry, but my time budget is also overflowing, so I guess we'll just have to leave this as an enhancement.
Comment 6 Eclipse Webmaster CLA 2019-09-06 16:06:24 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.