| Summary: | pack() on dialog with table doesn't take task bar into account when sizing | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Larry Colson <lcolson> | ||||
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> | ||||
| Status: | CLOSED NOT_ECLIPSE | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | eclipse.felipe, lcolson | ||||
| Version: | 3.5.2 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Larry Colson
Created attachment 175898 [details]
Test case
I reported this a couple of months ago. I'm starting to get a lot of customer complaints since they often have to resize dialog boxes to be able to see the buttons on the bottom. I wanted to see if someone could take a look at it. Hi, sorry for the delayed answer. Things are pretty busy around here. I finally had a change to take a lot at your snippet. The problem is in the application code. You can't expect shell.pack() to cap the size of the shell to the client area of the display. That is not what it does. The table in the shell has 1000 items it forces pack size of the shell to be over 1400px in height (windows caps the size of the shell to the bounds of the display, but that is platform behaviour - you should not relie on that neither). For your code to work as you expect you should, remove: shell.pack(); and add: Point size = shell.computeSize(SWT.DEFAULT, SWT.DEFAULT); Rectangle maxSize = shell.getDisplay().getClientArea(); if (size.x > maxSize.width) size.x = maxSize.width; if (size.y > maxSize.height) size.y = maxSize.height; shell.setSize(size); |