Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java10
1 files changed, 8 insertions, 2 deletions
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
index fb8dc082e6..d290179e28 100644
--- 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
@@ -3165,8 +3165,14 @@ void setBackgroundColor (long /*int*/ context, long /*int*/ handle, GdkRGBA rgba
GdkColor defaultColor = getDisplay().COLOR_LIST_SELECTION;
GdkRGBA selectedBackground = display.toGdkRGBA (defaultColor);
if (OS.GTK_VERSION >= OS.VERSION(3, 16, 0)) {
- String css = "GtkTreeView {background-color: " + display.gtk_rgba_to_css_string(background) + ";}\n"
- + "GtkTreeView:selected {background-color: " + display.gtk_rgba_to_css_string(selectedBackground) + ";}";
+ String css;
+ if (OS.GTK_VERSION >= OS.VERSION(3, 20, 0)) {
+ css = "treeview {background-color: " + display.gtk_rgba_to_css_string(background) + ";}\n"
+ + "treeview:selected {background-color: " + display.gtk_rgba_to_css_string(selectedBackground) + ";}";
+ } else {
+ css = "GtkTreeView {background-color: " + display.gtk_rgba_to_css_string(background) + ";}\n"
+ + "GtkTreeView:selected {background-color: " + display.gtk_rgba_to_css_string(selectedBackground) + ";}";
+ }
// Cache background color
cssBackground = css;

Back to the top