| Summary: | [ToolBar] Preferred size too wide | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Ralf Sternberg <rsternberg> | ||||||
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> | ||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | ruediger.herrmann | ||||||
| Version: | 1.0 | Flags: | ruediger.herrmann:
review+
|
||||||
| Target Milestone: | 1.1.1 | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 190072 | ||||||||
| Attachments: |
|
||||||||
Created attachment 102059 [details]
Screenshot of the sample snippet
Created attachment 102960 [details]
Patch that repairs the width computation of ToolItem
With this patch the computed width matches exactly the real client-side width.
In getWidth(), there were 11 px added in favor of the workbench perspective switcher. I assume that this appeared in TextSizeEstimation times and is now obsolete. Although the perspective switcher is still too small in the first session, I do not see a difference through this patch.
Not sure whether this is critical enough to commit it into the release. Anyway, I think it's harmless. Fixed in CVS HEAD. Size computation works correct now for ToolItem and ToolBar. |
The width computed by ToolBars exceeds the width of the included ToolItems. public class ToolBarSnippet implements IEntryPoint { public int createUI() { Display display = new Display(); Shell shell = new Shell( display ); shell.setText( "ToolBar Snippet" ); shell.setLayout( new GridLayout() ); ToolBar toolBar = new ToolBar( shell, SWT.BORDER ); new ToolItem( toolBar, SWT.PUSH ).setText( "Item 1" ); new ToolItem( toolBar, SWT.PUSH ).setText( "Item 2" ); shell.setSize( 400, 300 ); shell.open(); while( !shell.isDisposed() ) { if( !display.readAndDispatch() ) { display.sleep(); } } return 0; } }