47041fe
From 428cc3497ee844b9262d1bdc7cb09a8332eee87c Mon Sep 17 00:00:00 2001
47041fe
From: Eric Williams <ericwill@redhat.com>
47041fe
Date: Wed, 23 Dec 2015 09:55:43 -0500
47041fe
Subject: [PATCH] Bug 484696: [GTK] Empty repositories view links have white
47041fe
 backgrounds
47041fe
47041fe
After bug 479998, an empty EGit repositories view still has mismatched
47041fe
label colors. It turns out in this case the background color of the
47041fe
parent composite was incorrect -- it should have been white (like on
47041fe
GTK3.14 and earlier) instead of gray.
47041fe
47041fe
In this case the parent composite's background color is set to be that
47041fe
of the TreeViewer which will display the future repository branches,
47041fe
information, etc. The default color for Trees/Tables is white. The fixes
47041fe
for bug 479998 and bug 479998 introduced a small regression which set
47041fe
the default color of Table/Trees to be gray. The issue in this case does
47041fe
not lie with the labels but with the color of the parent composite. With
47041fe
Table/Trees returning their proper default background color (white, or
47041fe
COLOR_LIST_BACKGROUND), the EGit label issue is fixed.
47041fe
47041fe
Tested on GTK3.18.6, 3.16, 3.14, and 2.24. AllNonBrowser JUnit tests
47041fe
pass on GTK3 and GTK2.
47041fe
47041fe
Change-Id: I47fe95c1ad5fc87411c0f27ff344f6369c9aa0c6
47041fe
Signed-off-by: Eric Williams <ericwill@redhat.com>
47041fe
---
47041fe
 .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java   | 16 +++++++++++++---
47041fe
 .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java    | 16 +++++++++++++---
47041fe
 2 files changed, 26 insertions(+), 6 deletions(-)
47041fe
47041fe
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
47041fe
index 89bd414..2510efa 100644
47041fe
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java	
47041fe
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java	
47041fe
@@ -3138,7 +3148,7 @@ void setBackgroundColor (long /*int*/ context, long /*int*/ handle, GdkRGBA rgba
47041fe
 	selectedBackground.green = (defaultColor.green & 0xFFFF) / (float)0xFFFF;
47041fe
 	selectedBackground.blue = (defaultColor.blue & 0xFFFF) / (float)0xFFFF;
47041fe
 	if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) {
47041fe
-		String css = "GtkTreeView {background-color: " + gtk_rgba_to_css_string(rgba) + ";}\n"
47041fe
+		String css = "GtkTreeView {background-color: " + gtk_rgba_to_css_string(background) + ";}\n"
47041fe
 				+ "GtkTreeView:selected {background-color: " + gtk_rgba_to_css_string(selectedBackground) + ";}";
47041fe
 		gtk_css_provider_load_from_css(context, css);
47041fe
 	} else {
47041fe
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
47041fe
index f8aaa6a..23cf3dc 100644
47041fe
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java	
47041fe
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java	
47041fe
@@ -3123,7 +3133,7 @@ void setBackgroundColor (long /*int*/ context, long /*int*/ handle, GdkRGBA rgba
47041fe
 	selectedBackground.green = (defaultColor.green & 0xFFFF) / (float)0xFFFF;
47041fe
 	selectedBackground.blue = (defaultColor.blue & 0xFFFF) / (float)0xFFFF;
47041fe
 	if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) {
47041fe
-		String css = "GtkTreeView {background-color: " + gtk_rgba_to_css_string(rgba) + ";}\n"
47041fe
+		String css = "GtkTreeView {background-color: " + gtk_rgba_to_css_string(background) + ";}\n"
47041fe
 				+ "GtkTreeView:selected {background-color: " + gtk_rgba_to_css_string(selectedBackground) + ";}";
47041fe
 		gtk_css_provider_load_from_css(context, css);
47041fe
 	} else {
47041fe
-- 
47041fe
2.5.0
47041fe