Fix unreadable autocomplete selection.

This commit is contained in:
Alexander Kurtakov 2014-09-18 12:40:42 +03:00
parent 0cce5fa515
commit 76040486b8
2 changed files with 102 additions and 1 deletions

96
eclipse-bug-444143.patch Normal file
View File

@ -0,0 +1,96 @@
From 716d35d30c1f639a04515188fedd89bb3aaf12bc Mon Sep 17 00:00:00 2001
From: Sami Wagiaalla
Date: Mon, 15 Sep 2014 11:51:44 -0400
Subject: Bug 444143 - [GTK3] Reset selected background color in Table
When setBackgroundColor is called for Table it results in
a call to gtk_widget_override_background_color with the flag
GTK_STATE_FLAG_NORMAL which overrides the color for selected
items' background despite the flag. Therefore the selected item
color must be reset to the default.
Change-Id: Iab3cad4e01cf87cca04e536fdea8991c818d0336
Signed-off-by: Sami Wagiaalla <swagiaal@redhat.com>
diff --git a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
index 96493c6..2558fd1 100644
--- a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
+++ b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
@@ -11,12 +11,28 @@
package org.eclipse.swt.widgets;
-import org.eclipse.swt.*;
-import org.eclipse.swt.internal.*;
-import org.eclipse.swt.internal.cairo.*;
-import org.eclipse.swt.internal.gtk.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.events.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.internal.Converter;
+import org.eclipse.swt.internal.ImageList;
+import org.eclipse.swt.internal.cairo.Cairo;
+import org.eclipse.swt.internal.gtk.GdkColor;
+import org.eclipse.swt.internal.gtk.GdkEventButton;
+import org.eclipse.swt.internal.gtk.GdkEventExpose;
+import org.eclipse.swt.internal.gtk.GdkRGBA;
+import org.eclipse.swt.internal.gtk.GdkRectangle;
+import org.eclipse.swt.internal.gtk.GtkAllocation;
+import org.eclipse.swt.internal.gtk.GtkCellRendererClass;
+import org.eclipse.swt.internal.gtk.GtkRequisition;
+import org.eclipse.swt.internal.gtk.OS;
/**
* Instances of this class implement a selectable user interface
@@ -3006,6 +3022,17 @@ void setBackgroundColor (GdkColor color) {
super.setBackgroundColor (color);
if (!OS.GTK3) {
OS.gtk_widget_modify_base (handle, 0, color);
+ } else {
+ // Setting the background color overrides the selected background color
+ // so we have to reset it the default.
+ GdkColor defaultColor = getDisplay().COLOR_LIST_SELECTION;
+ GdkRGBA selectedBackground = new GdkRGBA ();
+ selectedBackground.alpha = 1;
+ selectedBackground.red = (defaultColor.red & 0xFFFF) / (float)0xFFFF;
+ selectedBackground.green = (defaultColor.green & 0xFFFF) / (float)0xFFFF;
+ selectedBackground.blue = (defaultColor.blue & 0xFFFF) / (float)0xFFFF;
+
+ OS.gtk_widget_override_background_color (handle, OS.GTK_STATE_FLAG_SELECTED, selectedBackground);
}
}
diff --git a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
index 2a40869..4603cff 100644
--- a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
+++ b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
@@ -3038,6 +3038,17 @@ void setBackgroundColor (GdkColor color) {
super.setBackgroundColor (color);
if (!OS.GTK3) {
OS.gtk_widget_modify_base (handle, 0, color);
+ } else {
+ // Setting the background color overrides the selected background color
+ // so we have to reset it the default.
+ GdkColor defaultColor = getDisplay().COLOR_LIST_SELECTION;
+ GdkRGBA selectedBackground = new GdkRGBA ();
+ selectedBackground.alpha = 1;
+ selectedBackground.red = (defaultColor.red & 0xFFFF) / (float)0xFFFF;
+ selectedBackground.green = (defaultColor.green & 0xFFFF) / (float)0xFFFF;
+ selectedBackground.blue = (defaultColor.blue & 0xFFFF) / (float)0xFFFF;
+
+ OS.gtk_widget_override_background_color (handle, OS.GTK_STATE_FLAG_SELECTED, selectedBackground);
}
}
--
cgit v0.10.1-9-gd18e

View File

@ -39,7 +39,7 @@ Epoch: 1
Summary: An open, extensible IDE
Name: %{?scl_prefix}eclipse
Version: %{eclipse_version}
Release: 13.1%{?dist}
Release: 13.2%{?dist}
License: EPL
Group: Development/Tools
URL: http://www.eclipse.org/
@ -115,6 +115,7 @@ Patch22: %{pkg_name}-policy-comparators.patch
# https://bugs.eclipse.org/bugs/show_bug.cgi?id=438992
Patch23: %{pkg_name}-bug-438992.patch
Patch24: %{pkg_name}-webkit2-support.patch
Patch25: %{pkg_name}-bug-444143.patch
BuildRequires: rsync
BuildRequires: make, gcc
@ -329,6 +330,7 @@ tar --strip-components=1 -xf %{SOURCE1}
%patch22
%patch23 -p1
%patch24
%patch25 -p1
#Disable as many things as possible to make the build faster. We care only for Eclipse.
%pom_disable_module platform.sdk eclipse.platform.releng.tychoeclipsebuilder
@ -1026,6 +1028,9 @@ fi
%{_libdir}/%{pkg_name}/plugins/org.eclipse.osgi.compatibility.state_*
%changelog
* Thu Sep 18 2014 Alexander Kurtakov <akurtako@redhat.com> 1:4.4.0-13.2
- Fix unreadable autocomplete selection.
* Wed Aug 20 2014 Mat Booth <mat.booth@redhat.com> - 1:4.4.0-13.1
- Merge in changes from latest f21