File: tooltip-color.patch

package info (click to toggle)
eclipse 3.5.2-6squeeze2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 297,208 kB
  • ctags: 426,326
  • sloc: java: 2,527,099; ansic: 122,607; xml: 100,868; cpp: 33,545; jsp: 3,869; sh: 2,557; perl: 1,650; makefile: 272; csh: 151; python: 69; php: 24
file content (47 lines) | stat: -rw-r--r-- 1,814 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
diff -u -r1.25 ToolTip.java
--- a/plugins/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java	2 Dec 2009 15:52:39 -0000
+++ b/plugins/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolTip.java	13 May 2010 15:59:10 -0000
@@ -48,6 +48,7 @@
 	TrayItem item;
 	int x, y, timerId;
 	int /*long*/ layoutText = 0, layoutMessage = 0;
+	Color layoutTextColor, layoutMessageColor;
 	int [] borderPolygon;
 	boolean spikeAbove, autohide;
 	
@@ -498,6 +499,9 @@
 			x += IMAGE_SIZE;
 		}
 		x += INSET;
+		if (layoutTextColor != null) {
+			OS.gdk_gc_set_foreground(gdkGC, layoutTextColor.handle);
+		}
 		OS.gdk_draw_layout (window, gdkGC, x, y, layoutText);
 		int [] w = new int [1], h = new int [1];
 		OS.pango_layout_get_size (layoutText, w, h);
@@ -505,6 +509,9 @@
 	}
 	if (layoutMessage != 0) {
 		x = BORDER + PADDING + INSET;
+		if (layoutMessageColor != null) {
+			OS.gdk_gc_set_foreground(gdkGC, layoutMessageColor.handle);
+		}
 		OS.gdk_draw_layout (window, gdkGC, x, y, layoutMessage);
 	}
 	OS.g_object_unref (gdkGC);
@@ -708,6 +715,7 @@
 	if (layoutMessage != 0) OS.g_object_unref (layoutMessage);
 	layoutMessage = 0;
 	if (message.length () != 0) {
+		layoutMessageColor = display.getSystemColor(SWT.COLOR_INFO_FOREGROUND);
 		byte [] buffer = Converter.wcsToMbcs (null, message, true);
 		layoutMessage = OS.gtk_widget_create_pango_layout (handle, buffer);
 		if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {
@@ -739,6 +747,7 @@
 	if (layoutText != 0) OS.g_object_unref (layoutText);
 	layoutText = 0;
 	if (text.length () != 0) {
+		layoutTextColor = display.getSystemColor(SWT.COLOR_INFO_FOREGROUND);
 		byte [] buffer = Converter.wcsToMbcs (null, text, true);
 		layoutText = OS.gtk_widget_create_pango_layout (handle, buffer);
 		if (OS.GTK_VERSION >= OS.VERSION (2, 4, 0)) {