| Summary: | Link does not wrap without vertical fill | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Markus Keller <markus.kell.r> | ||||
| Component: | SWT | Assignee: | Scott Kovatch <skovatch> | ||||
| Status: | RESOLVED FIXED | QA Contact: | Silenio Quarti <Silenio_Quarti> | ||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | eclipse.felipe, harp, skovatch | ||||
| Version: | 3.5 | Flags: | eclipse.felipe:
review+
|
||||
| Target Milestone: | 3.6 RC1 | ||||||
| Hardware: | PC | ||||||
| OS: | Mac OS X | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Markus Keller
Link.computeSize has a TODO in it that basically says it isn't implemented. This is pretty safe to add for 3.6. Created attachment 167260 [details]
Fix
Implemented computeSize using code from the multiline Text case. Also cleaned up creation of the widget so that the BORDER and non-BORDER case has a consistent gap around it, and matches Carbon.
Felipe, can you review? Good to go, two (small) things I might have done differently: 1) Why setting the line fragment padding to zero when no border ? we don't do that for any other widget causes the different in the size of no border/border to be greater. 2) Link#computeSize() started with if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0; This code is correct IMO and was removed by the patch. (In reply to comment #4) > Good to go, > > two (small) things I might have done differently: > 1) Why setting the line fragment padding to zero when no border ? > we don't do that for any other widget > causes the different in the size of no border/border to be greater. This is done primarily for compatibility/fidelity with Carbon. A Link is implemented with an NSTextView, but shouldn't look any different than a Label. That was fixed in bug 276115. Turns out this was slightly wrong anyway. I should set the padding to 2 all the time and then adjust the height and width returned in computeSize if there isn't a border. This way the size of the widget is the same whether or not there's a border, and it has the same appearance as a Label. > 2) Link#computeSize() started with > if (wHint != SWT.DEFAULT && wHint < 0) wHint = 0; > if (hHint != SWT.DEFAULT && hHint < 0) hHint = 0; > > This code is correct IMO and was removed by the patch. I had taken this out because the WRAP case from Text didn't have it, but now that I understand what it's doing, yes, it should go back. Fixed > 20100506. |