aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2013-03-27 13:16:00 (EDT)
committerCarolyn MacLeod2013-04-09 10:56:59 (EDT)
commit4addcf9877ef38b5e4a86a086e54a75992610577 (patch)
tree26bcf9cf8178db3108a78184235d67d64e5f9142
parent2d8439a81354de78a8d432938e2d753fd3fe098f (diff)
downloadeclipse.platform.swt-4addcf9877ef38b5e4a86a086e54a75992610577.zip
eclipse.platform.swt-4addcf9877ef38b5e4a86a086e54a75992610577.tar.gz
eclipse.platform.swt-4addcf9877ef38b5e4a86a086e54a75992610577.tar.bz2
Bug 398748 - [GTK3] Text in Javadoc hover unreadable on Ubuntu 12.04
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java25
1 files changed, 24 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
index 576ac5d..f41ab74 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Display.java
@@ -2279,6 +2279,29 @@ GdkColor toGdkColor (GdkRGBA rgba, double m) {
return gdkColor;
}
+void getBackgroundColor (long /*int*/ context, int state, GdkRGBA rgba) {
+ /*
+ * Draw the context background to an offset screen surface and get the color
+ * in the middle of the surface.
+ */
+ OS.gtk_style_context_save (context);
+ OS.gtk_style_context_set_state (context, state);
+ long /*int*/ surface = Cairo.cairo_image_surface_create (Cairo.CAIRO_FORMAT_RGB24, 1, 1);
+ long /*int*/ cairo = Cairo.cairo_create (surface);
+ OS.gtk_render_background (context, cairo, -50, -50, 100, 100);
+ Cairo.cairo_fill (cairo);
+ Cairo.cairo_surface_flush (surface);
+ byte[] buffer = new byte[3];
+ OS.memmove (buffer, Cairo.cairo_image_surface_get_data(surface), buffer.length);
+ rgba.red = buffer[2] / 255f;
+ rgba.green = buffer[1] / 255f;
+ rgba.blue = buffer[0] / 255f;
+ rgba.alpha = 1;
+ Cairo.cairo_surface_destroy (surface);
+ Cairo.cairo_destroy (cairo);
+ OS.gtk_style_context_restore (context);
+}
+
void initializeSystemColors () {
long /*int*/ tooltipShellHandle = OS.gtk_window_new (OS.GTK_WINDOW_POPUP);
if (tooltipShellHandle == 0) error (SWT.ERROR_NO_HANDLES);
@@ -2309,7 +2332,7 @@ void initializeSystemColors () {
GdkRGBA rgba = new GdkRGBA();
OS.gtk_style_context_get_color (context, OS.GTK_STATE_FLAG_NORMAL, rgba);
COLOR_INFO_FOREGROUND = toGdkColor (rgba);
- OS.gtk_style_context_get_background_color (context, OS.GTK_STATE_FLAG_NORMAL, rgba);
+ getBackgroundColor (context, OS.GTK_STATE_FLAG_NORMAL, rgba);
COLOR_INFO_BACKGROUND = toGdkColor (rgba);
OS.gtk_widget_destroy (tooltipShellHandle);