| Summary: | [GTK3] SWT.FLAT for Toolbar buttons does not work | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Anatoly Spektor <spektor.anatoly> |
| Component: | SWT | Assignee: | Platform-SWT-Inbox <platform-swt-inbox> |
| Status: | RESOLVED WORKSFORME | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | akurtakov, ericwill, robert.roth.off, Silenio_Quarti |
| Version: | 4.3 | Keywords: | triaged |
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 340067 | ||
I think this is actually a problem on the GTK2 SWT build (on Fedora 18). The buttons should draw the border (relief) around them when the mouse hovers over it even when SWT.FLAT is specified. The is the behavior on Fedora 17 for GTK2 and it got broken on Fedora 18. I can confirm that the buttons look the same with both SWT.NONE and SWT.FLAT, but in both cases they are flat (no borders, only on hover), and can be checked that in both cases they have the .flat CSS style class assigned to them, because they are toolbuttons. Is this still an issue for you? Unless anyone says otherwise I'll close the bug as no further work is necessary IMHO. |
How to reproduce: 1. Run Eclipse + GTK3 2. Hover to any Toolbar button You will see that buttons that suppose to be flat are not flat. Also you can try this snippet (try passing SWT.NONE and SWT.FLAT when creating Toolbar): import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.*; public class ToolBarTest { public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setLayout(new GridLayout(1, false)); Image image = display.getSystemImage(SWT.ICON_ERROR); // Try it with SWT.FLAT and without - no difference ToolBar bar = new ToolBar(shell, SWT.FLAT); bar.setBackground(display.getSystemColor(SWT.COLOR_GREEN)); for (int i = 0; i < 4; i++) { int style = SWT.PUSH; ToolItem item = new ToolItem(bar, style); item.setImage(image); } Point size; shell.open(); size = bar.computeSize(SWT.DEFAULT, SWT.DEFAULT); System.out.println("size=" + size); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); } }