ToolBar/ToolItem background colour on TabItems [message #529371] |
Sat, 24 April 2010 04:43  |
Eclipse User |
|
|
|
Hi,
recently, I came across some (perhaps) weird colouring problem when creating a ToolBar on a TabItem. Consider the following snippet:
package snippets;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
public final class TabItemSnippet {
private final Display display = new Display();
private final Shell shell = new Shell(display);
public static void main(String[] args) {
new TabItemSnippet();
}
public TabItemSnippet() {
shell.setLayout(new FillLayout());
TabFolder tabFolder = new TabFolder(shell, SWT.NONE);
TabItem tabItem = new TabItem(tabFolder, SWT.NONE);
tabItem.setText("A TabItem"); //$NON-NLS-1$
Composite composite = new Composite(tabFolder, SWT.NONE);
composite.setLayout(new GridLayout());
ToolBar toolBar = new ToolBar(composite, SWT.FLAT);
ToolItem toolItem = new ToolItem(toolBar, SWT.NONE);
toolItem.setText("A ToolItem with non-matching background"); //$NON-NLS-1$
tabItem.setControl(composite);
shell.open();
while (!shell.isDisposed())
if (!display.readAndDispatch())
display.sleep();
display.dispose();
}
}
When executed on GTK (2.18.3), this displays as follows:

Is this intentional, or rather a bug?
Kind regards,
Karsten
|
|
|
|
Re: ToolBar/ToolItem background colour on TabItems [message #529551 is a reply to message #529371] |
Mon, 26 April 2010 06:52  |
Eclipse User |
|
|
|
Hm, seems I am not allowed to attach files to a posting..
You should be able to see the attachment here.. But that is in fact the same URL as in my initial posting, so you might not see the image either. If so, I might try and send you a PM or an e-mail with the image attached.
Kind regards,
Karsten
|
|
|
Powered by
FUDForum. Page generated in 0.06511 seconds