Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEric Williams2019-07-11 17:19:37 +0000
committerEric Williams2019-07-16 17:48:08 +0000
commit7493e9681dc1c9f2615aace63ac0794bf8217589 (patch)
treed26e0b11de39da3ef51252005b35d2dd2b7d0db3 /tests
parent0eadc0ae481846c912ee170d0b1c148758c0ed81 (diff)
downloadeclipse.platform.swt-7493e9681dc1c9f2615aace63ac0794bf8217589.tar.gz
eclipse.platform.swt-7493e9681dc1c9f2615aace63ac0794bf8217589.tar.xz
eclipse.platform.swt-7493e9681dc1c9f2615aace63ac0794bf8217589.zip
Bug 549101: [GTK] Label background set from parent background, but the colors are not equal
Use getRed(), getGreen(), getBlue(), and getAlpha() methods in Color.equals() and Color.hashcode(). Verified with the bug snippet attached, and in a child Eclipse. No AllNonBrowser JUnit tests fail. Change-Id: Ice1db1db5a2d0a0bac3c148a6d003d2dee6783bb Signed-off-by: Eric Williams <ericwill@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug549101_LabelBackgroundNotEqual.java51
1 files changed, 51 insertions, 0 deletions
diff --git a/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug549101_LabelBackgroundNotEqual.java b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug549101_LabelBackgroundNotEqual.java
new file mode 100644
index 0000000000..f718b779e9
--- /dev/null
+++ b/tests/org.eclipse.swt.tests.gtk/ManualTests/org/eclipse/swt/tests/gtk/snippets/Bug549101_LabelBackgroundNotEqual.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2019 Simeon Andreev and others. All rights reserved.
+ * The contents of this file are made available under the terms
+ * of the GNU Lesser General Public License (LGPL) Version 2.1 that
+ * accompanies this distribution (lgpl-v21.txt). The LGPL is also
+ * available at http://www.gnu.org/licenses/lgpl.html. If the version
+ * of the LGPL at http://www.gnu.org is different to the version of
+ * the LGPL accompanying this distribution and there is any conflict
+ * between the two license versions, the terms of the LGPL accompanying
+ * this distribution shall govern.
+ *
+ * Contributors:
+ * Simeon Andreev - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.tests.gtk.snippets;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+public class Bug549101_LabelBackgroundNotEqual {
+
+ public static void main(String[] args) {
+ final Display display = new Display();
+ Shell shell = new Shell(display);
+ shell.setSize(500, 80);
+ shell.setLayout(new FillLayout(SWT.HORIZONTAL));
+ shell.setText("Bug");
+
+ Composite co = new Composite(shell, SWT.NONE);
+ co.setLayout(new FillLayout(SWT.HORIZONTAL));
+ Label l = new Label(co, SWT.NONE);
+ l.setBackground(co.getBackground());
+
+ boolean equalColors = l.getBackground().equals(co.getBackground());
+ l.setText("colors equal: " + equalColors);
+
+ shell.open();
+
+ while (!shell.isDisposed()) {
+ if (!display.readAndDispatch()) {
+ display.sleep();
+ }
+ }
+ display.dispose();
+ }
+
+}

Back to the top