Blob Blame Raw
From a41f152c868984b41b73945f374966ad621c3e13 Mon Sep 17 00:00:00 2001
From: Snjezana Peco
Date: Thu, 21 May 2015 10:41:39 +0200
Subject: Bug 466499 - [GTK3] Path text not drawn in column of commit dialog
 window

Change-Id: I508432a354314ca11839e03fbac7b5adc44fff3c
Signed-off-by: Snjezana Peco <snjeza.peco@gmail.com>
---
 .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java  |  3 ++-
 .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java   | 17 ++++-------------
 2 files changed, 6 insertions(+), 14 deletions(-)

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 e49865b..9b904ad 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	
@@ -2662,7 +2662,8 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
 		}
 	}
 	if (item != null) {
-		if (OS.GTK_IS_CELL_RENDERER_TOGGLE (cell) || (OS.GTK_IS_CELL_RENDERER_PIXBUF (cell) && (columnIndex != 0 || (style & SWT.CHECK) == 0))) {
+		if (OS.GTK_IS_CELL_RENDERER_TOGGLE (cell) ||
+				( (OS.GTK_IS_CELL_RENDERER_PIXBUF (cell) || OS.GTK_VERSION > OS.VERSION(3, 13, 0)) && (columnIndex != 0 || (style & SWT.CHECK) == 0))) {
 			drawFlags = (int)/*64*/flags;
 			drawState = SWT.FOREGROUND;
 			long /*int*/ [] ptr = new long /*int*/ [1];
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 4d5448a..bc64152 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	
@@ -2675,7 +2675,8 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
 		}
 	}
 	if (item != null) {
-		if (OS.GTK_IS_CELL_RENDERER_TOGGLE (cell) || (OS.GTK_IS_CELL_RENDERER_PIXBUF (cell) && (columnIndex != 0 || (style & SWT.CHECK) == 0))) {
+		if (OS.GTK_IS_CELL_RENDERER_TOGGLE (cell) ||
+				( (OS.GTK_IS_CELL_RENDERER_PIXBUF (cell) || OS.GTK_VERSION > OS.VERSION(3, 13, 0)) && (columnIndex != 0 || (style & SWT.CHECK) == 0))) {
 			drawFlags = (int)/*64*/flags;
 			drawState = SWT.FOREGROUND;
 			long /*int*/ [] ptr = new long /*int*/ [1];
@@ -2775,9 +2776,6 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
 				sendEvent (SWT.EraseItem, event);
 				drawForeground = null;
 				drawState = event.doit ? event.detail : 0;
-				if (OS.GTK3 && OS.GTK_VERSION <= OS.VERSION(3, 14, 8)) {
-					drawState |= SWT.FOREGROUND;
-				}
 				drawFlags &= ~(OS.GTK_CELL_RENDERER_FOCUSED | OS.GTK_CELL_RENDERER_SELECTED);
 				if ((drawState & SWT.SELECTED) != 0) drawFlags |= OS.GTK_CELL_RENDERER_SELECTED;
 				if ((drawState & SWT.FOCUSED) != 0) drawFlags |= OS.GTK_CELL_RENDERER_FOCUSED;
@@ -2821,10 +2819,8 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
 		if (OS.GTK_IS_CELL_RENDERER_TEXT (cell)) {
 			if (hooks (SWT.PaintItem)) {
 				GdkRectangle rect = new GdkRectangle ();
-				GdkRectangle clipRect = new GdkRectangle ();
 				long /*int*/ path = OS.gtk_tree_model_get_path (modelHandle, iter);
 				OS.gtk_tree_view_get_cell_area (handle, path, columnHandle, rect);
-				OS.gtk_tree_view_get_background_area (handle, path, columnHandle, clipRect);
 				OS.gtk_tree_path_free (path);
 				// A workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=459117
 				if (cr != 0 && OS.GTK_VERSION > OS.VERSION(3, 9, 0) && OS.GTK_VERSION <= OS.VERSION(3, 14, 8)) {
@@ -2877,12 +2873,9 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
 				gc.setFont (item.getFont (columnIndex));
 				if ((style & SWT.MIRRORED) != 0) {
 					rect.x = getClientWidth () - rect.width - rect.x;
-					clipRect.x = getClientWidth () - clipRect.width - clipRect.x;
 				}
 
-				if (!OS.GTK3){
-					gc.setClipping (clipRect.x, clipRect.y, clipRect.width, clipRect.height);
-				}
+				gc.setClipping (rect.x, rect.y, rect.width, rect.height);
 
 				Event event = new Event ();
 				event.item = item;
@@ -2893,9 +2886,7 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
 				event.width = contentWidth [0];
 				event.height = rect.height;
 				event.detail = drawState;
-				if (!OS.GTK3 || OS.GTK_VERSION > OS.VERSION(3, 14, 8)) {
-					sendEvent (SWT.PaintItem, event);
-				}
+				sendEvent(SWT.PaintItem, event);
 				gc.dispose();
 			}
 		}
-- 
cgit v0.11.2-4-g4a35