| Summary: | TableEditor setting a Button control in a Table is not aligned properly | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Kevin Tapperson <kevintap> | ||||||||
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> | ||||||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | ericwill, remy.suen | ||||||||
| Version: | 4.1 | Keywords: | triaged | ||||||||
| Target Milestone: | --- | ||||||||||
| Hardware: | Other | ||||||||||
| OS: | Linux | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Kevin Tapperson
Created attachment 192321 [details]
screenshot on Linux
Created attachment 192322 [details]
screenshot on Windows
Created attachment 192323 [details]
sample code
Attached is a simple test case which brings up an SWT window and renders a table using a TableEditor. The TableEditor sets a button to be the editor control for a cell in the table, which is rendered with inappropriate spacing.
Still reproducible on 4.8 M7, GTK3.22, and Fedora 28. (In reply to Eric Williams from comment #4) > Still reproducible on 4.8 M7, GTK3.22, and Fedora 28. In addition, it seems that the image isn't being set properly on the button -- the button is blank. After further investigation I've determined that this is desired behaviour. I tested on Mac -- the button appears at the intended place, but is glitchy. Clicking the button works but it hops around to the offset (the size of the image + 2px), and then back. Looking into the code, TableEditor.computeBounds() queries the size of the image when determining where to place the editor widget. This in turn calls TableItem.getImageBounds(), which (on GTK2 and 3) correctly returns a rectangle describing the position and size of the images set in the Table. I'm not sure why this only "kind of" works on Mac, but Windows seems to do this as well. I'll look into the button image issue, and file a separate ticket for that bug. Otherwise this one will be closed as WONTFIX. (In reply to Eric Williams from comment #6) > I'll look into the button image issue, and file a separate ticket for that > bug. Otherwise this one will be closed as WONTFIX. I couldn't get the image issue to reproduce further in a separate snippet. Closing this ticket now. |