Bug 30804 - DCR - GridLayout should not treat width/height hint as minumum size when grab/fill is specified
Summary: DCR - GridLayout should not treat width/height hint as minumum size when grab...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Veronika Irvine CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 30708 (view as bug list)
Depends on:
Blocks: 31080 31488
  Show dependency tree
 
Reported: 2003-02-03 05:31 EST by Dirk Baeumer CLA
Modified: 2004-09-30 19:45 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Baeumer CLA 2003-02-03 05:31:46 EST
The GridLayout manager treats the width and height hint as a minumum width even 
if fill and grab is specified for the cell. But is doesn't treat it as a 
maximum width. This makes it hard to design dialogs which are opened on 
a "smaller" screen. Consider the following example:

- a shell with a tree and some label below the tree
- the layout is managed by a GridLayout manager.
- we specify a width hint of 500 for the tree and make it fill and grab.

Open the dialog. When you resize it (make it larger) the tree gets enlarged as 
well. If you make the dialog small the tree get clipped.

When you now open the dialog on a smaller screen (600x480) the tree gets 
clipped right from the beginning.
Comment 1 Steve Northover CLA 2003-02-03 16:27:49 EST
VI is the closest we have to a grid expert.  I think I understand what he is 
saying and it seems to make sense.  Basically, if you think in "form layout" 
terminology, the widget is attached on all sides and should be "rubber".

Lynne, I added you because you are the original grid author.  Do you have any 
comments?

I don't think we should fix this for 2.1 because of the risk.
Comment 2 Veronika Irvine CLA 2003-02-03 16:48:33 EST
There was a previous request by Eduardo to have a preferred width.  This would 
be used when computing the preferred size but would not interfere with the 
other aspects of GridData such as fill horizontal etc.  I think this 
enhancement may provide what Dirk is looking for.  I don't think we will be 
adding this for 2.1.
Comment 3 Dirk Baeumer CLA 2003-02-04 04:11:27 EST
But we have PRs that some of your dialogs get clipped when using low resolution.
Comment 4 Veronika Irvine CLA 2003-02-10 13:13:25 EST
Dirk,
Which dialog(s) are you concerned about?  Point me at the source code and I 
will have a look at what can be done.  I think FormLayout may be a better 
answer.

I really do not think we can change the behaviour of GridLayout - others rely 
on it behaving as it does currently plus it is an involved piece of code that 
Eclipse relies on heavily and I do not want to screw everything else up by 
modifying it.

Comment 5 Dirk Baeumer CLA 2003-02-11 04:14:28 EST
Most of the PRs are related to High contrast mode under Windows. See bug 30616 
as an example. As far as I know it isn't clear yet on which resolution Eclipse 
has to support high contrast mode.

Another bug is 31080. These bugs can be fixed by tweaking the width hint, but 
this can't be the final solution since it depends on various other aspects 
(font, os, ...).

If we follow the path to tweak the hint then SWT should comment on bug 31278.
Comment 6 Veronika Irvine CLA 2004-08-19 10:08:24 EDT
*** Bug 30708 has been marked as a duplicate of this bug. ***
Comment 7 Veronika Irvine CLA 2004-09-30 18:50:08 EDT
Fixed in 3.1 > Sept 30.

widthHint, heightHint are the values passed into Control.computeSize(int, int, 
boo to determine the preferred size of the control (e.g. in shell.pack()).

New fields minWidth and minHeight are used to define the minimum width and 
height of the control.  By default the minimums are 0.  

A minimum value of SWT.DEFAULT means use the result of Control.computeSize 
with widthHint or heightHint to determine the minimum size.
Comment 8 Steve Northover CLA 2004-09-30 19:45:00 EDT
Wait ... shouldn't those fields be named "minimumWidth" and "minimumHeight"?  
I know the names are longer but we don't use short forms in API names and we 
already have Shell.setMinimumSize() and ScrollBar.setMinimum().

Please hold off using the new API until the names get finalized.  Thanks. 
Sorry about that everyone (including Veronika).