Community
Participate
Working Groups
When you create a ToolBar with the vertical style, the ToolItems will not span the entire width of the toolbar, creating a jagged and an unpolished look (IMO). You can see this behavior in Eclipse itself if you dock the perspective toolbar on the left. Can we please have an option to size the toolitems all to the maximum width?
It looks like Windows won't let you do this (after all the hacking we just did, fighting with the tool bar). FH to investigate (low priority?).
I'm not sure how to implement it. low priority (enhancement). Here is some code (win32 specific) I was playing with: public static void main(String[] args) { final Display display= new Display(); final Shell shell= new Shell(display); final ToolBar toolBar= new ToolBar(shell, SWT.VERTICAL |SWT.BORDER | SWT.FLAT); int TB_SETBUTTONWIDTH = 0x400 + 59;//0X43B int width = 100 + (101 << 16); org.eclipse.swt.internal.win32.OS.SendMessage(toolBar.handle, TB_SETBUTTONWIDTH, 0, width);//doesn't do anything new ToolItem (toolBar, SWT.PUSH).setText("Plus"); new ToolItem (toolBar, SWT.SEPARATOR); new ToolItem (toolBar, SWT.PUSH).setText("Java Perspect"); new ToolItem (toolBar, SWT.PUSH).setText("CVS Perspect"); new ToolItem (toolBar, SWT.PUSH).setText("Debug Perspect"); toolBar.pack(); shell.addListener(SWT.MouseDown, new Listener() { public void handleEvent(Event event) { ToolItem[] items = toolBar.getItems(); int width = 0; for (int i= 0; i < items.length; i++) { ToolItem item = items[i]; int w = item.getBounds().width; if (w > width) width = w; } TBBUTTONINFO info = new TBBUTTONINFO (); info.cbSize = TBBUTTONINFO.sizeof; info.dwMask = OS.TBIF_SIZE; info.cx = (short) width; int hwnd = toolBar.handle; for (int i= 0; i < items.length; i++) { OS.SendMessage (hwnd, OS.TB_SETBUTTONINFO, i, info); } } }); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } }
*** This bug has been marked as a duplicate of bug 139318 ***
Oops, not a dup.
Your bug has been moved to triage, visit http://www.eclipse.org/swt/triage.php for more info.
This is a one-off bulk update. (The last one in the triage migration). Moving bugs from swt-triaged@eclipse to platform-swt-inbox@eclipse.org and adding "triaged" keyword as per new triage process: https://wiki.eclipse.org/SWT/Devel/Triage See Bug 518478 for details. Tag for notification/mail filters: @TriageBulkUpdate