ToolBar/ToolItem background colour on TabItems [message #529371] |
Sat, 24 April 2010 08:43 |
Karsten Stöckmann Messages: 12 Registered: July 2009 |
Junior Member |
|
|
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02039 seconds