From dbf306e169f35af8aa89ffba3749d703dd45a450 Mon Sep 17 00:00:00 2001 From: Eric Williams Date: Tue, 9 Jan 2018 16:01:38 -0500 Subject: Bug 519295: [GTK3] Invisible settings button in validation preferences Bug snippet to reproduce the issue. Change-Id: Ida0ebe281bc2fa7e6b73d6a63ff78f38b34412a8 Signed-off-by: Eric Williams --- .../snippets/Bug519295_TableMultipleColumns.java | 74 ++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug519295_TableMultipleColumns.java diff --git a/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug519295_TableMultipleColumns.java b/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug519295_TableMultipleColumns.java new file mode 100644 index 0000000000..1623da11c5 --- /dev/null +++ b/tests/org.eclipse.swt.tests.gtk/Bug Snippets/org/eclipse/swt/tests/gtk/snippets/Bug519295_TableMultipleColumns.java @@ -0,0 +1,74 @@ +package org.eclipse.swt.tests.gtk.snippets; + +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.GC; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.TableItem; + +/* + * Title: Bug 519295: [GTK3] Invisible settings button in validation preferences + * How to run: launch snippet and observe TableItem columns + * Bug description: Image only appears in one column + * Expected results: Images should appear at least once in all columns + * GTK Version(s): GTK3 + */ +public class Bug519295_TableMultipleColumns { + public static void main(String[] args) { + Display display = Display.getDefault(); + Shell shell = new Shell(display); + shell.setLayout(new FillLayout()); + + Table tree = new Table(shell, SWT.NONE); + tree.setHeaderVisible(true); + + TableColumn column1 = new TableColumn(tree, SWT.LEFT); + column1.setText("Column 1"); + column1.setWidth(50); + TableColumn column2 = new TableColumn(tree, SWT.LEFT); + column2.setText("Column 2"); + column2.setWidth(50); + TableColumn column3 = new TableColumn(tree, SWT.LEFT); + column3.setText("Column 3"); + column3.setWidth(50); + + int W = 100, H = 100; + final Image xImage = new Image(display, W, H); + GC gc = new GC(xImage); + gc.setForeground(display.getSystemColor(SWT.COLOR_RED)); + gc.drawLine(0, 0, W - 1, H - 1); + gc.drawLine(0, H - 1, W - 1, 0); + gc.drawOval(1, 1, W - 2, H - 2); + gc.dispose(); + + int Wz = 40, Hz = 40; + final Image zImage = new Image(display, Wz, Hz); + GC gcz = new GC(zImage); + gcz.setForeground(display.getSystemColor(SWT.COLOR_RED)); + gcz.drawLine(0, 0, Wz - 1, Hz - 1); + gcz.drawLine(0, Hz - 1, Wz - 1, 0); + gcz.drawOval(1, 1, Wz - 2, Hz - 2); + gcz.dispose(); + + for (int i = 0; i < 12; i++) { + if (i != 3 && i != 6) { + TableItem item = new TableItem(tree, SWT.NONE); + item.setImage(i, xImage); + item.setText(i, "Test"); + } + } + + shell.pack(); + shell.open(); + + while (!shell.isDisposed()) { + if (!display.readAndDispatch()) + display.sleep(); + } + } + +} -- cgit v1.2.3