8f14e0
From a41f152c868984b41b73945f374966ad621c3e13 Mon Sep 17 00:00:00 2001
8f14e0
From: Snjezana Peco
8f14e0
Date: Thu, 21 May 2015 10:41:39 +0200
8f14e0
Subject: Bug 466499 - [GTK3] Path text not drawn in column of commit dialog
8f14e0
 window
8f14e0
8f14e0
Change-Id: I508432a354314ca11839e03fbac7b5adc44fff3c
8f14e0
Signed-off-by: Snjezana Peco <snjeza.peco@gmail.com>
8f14e0
---
8f14e0
 .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java  |  3 ++-
8f14e0
 .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java   | 17 ++++-------------
8f14e0
 2 files changed, 6 insertions(+), 14 deletions(-)
8f14e0
8f14e0
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
8f14e0
index e49865b..9b904ad 100644
8f14e0
--- a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java	
8f14e0
+++ b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java	
8f14e0
@@ -2662,7 +2662,8 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
8f14e0
 		}
8f14e0
 	}
8f14e0
 	if (item != null) {
8f14e0
-		if (OS.GTK_IS_CELL_RENDERER_TOGGLE (cell) || (OS.GTK_IS_CELL_RENDERER_PIXBUF (cell) && (columnIndex != 0 || (style & SWT.CHECK) == 0))) {
8f14e0
+		if (OS.GTK_IS_CELL_RENDERER_TOGGLE (cell) ||
8f14e0
+				( (OS.GTK_IS_CELL_RENDERER_PIXBUF (cell) || OS.GTK_VERSION > OS.VERSION(3, 13, 0)) && (columnIndex != 0 || (style & SWT.CHECK) == 0))) {
8f14e0
 			drawFlags = (int)/*64*/flags;
8f14e0
 			drawState = SWT.FOREGROUND;
8f14e0
 			long /*int*/ [] ptr = new long /*int*/ [1];
8f14e0
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
8f14e0
index 4d5448a..bc64152 100644
8f14e0
--- a/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java	
8f14e0
+++ b/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java	
8f14e0
@@ -2675,7 +2675,8 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
8f14e0
 		}
8f14e0
 	}
8f14e0
 	if (item != null) {
8f14e0
-		if (OS.GTK_IS_CELL_RENDERER_TOGGLE (cell) || (OS.GTK_IS_CELL_RENDERER_PIXBUF (cell) && (columnIndex != 0 || (style & SWT.CHECK) == 0))) {
8f14e0
+		if (OS.GTK_IS_CELL_RENDERER_TOGGLE (cell) ||
8f14e0
+				( (OS.GTK_IS_CELL_RENDERER_PIXBUF (cell) || OS.GTK_VERSION > OS.VERSION(3, 13, 0)) && (columnIndex != 0 || (style & SWT.CHECK) == 0))) {
8f14e0
 			drawFlags = (int)/*64*/flags;
8f14e0
 			drawState = SWT.FOREGROUND;
8f14e0
 			long /*int*/ [] ptr = new long /*int*/ [1];
8f14e0
@@ -2775,9 +2776,6 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
8f14e0
 				sendEvent (SWT.EraseItem, event);
8f14e0
 				drawForeground = null;
8f14e0
 				drawState = event.doit ? event.detail : 0;
8f14e0
-				if (OS.GTK3 && OS.GTK_VERSION <= OS.VERSION(3, 14, 8)) {
8f14e0
-					drawState |= SWT.FOREGROUND;
8f14e0
-				}
8f14e0
 				drawFlags &= ~(OS.GTK_CELL_RENDERER_FOCUSED | OS.GTK_CELL_RENDERER_SELECTED);
8f14e0
 				if ((drawState & SWT.SELECTED) != 0) drawFlags |= OS.GTK_CELL_RENDERER_SELECTED;
8f14e0
 				if ((drawState & SWT.FOCUSED) != 0) drawFlags |= OS.GTK_CELL_RENDERER_FOCUSED;
8f14e0
@@ -2821,10 +2819,8 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
8f14e0
 		if (OS.GTK_IS_CELL_RENDERER_TEXT (cell)) {
8f14e0
 			if (hooks (SWT.PaintItem)) {
8f14e0
 				GdkRectangle rect = new GdkRectangle ();
8f14e0
-				GdkRectangle clipRect = new GdkRectangle ();
8f14e0
 				long /*int*/ path = OS.gtk_tree_model_get_path (modelHandle, iter);
8f14e0
 				OS.gtk_tree_view_get_cell_area (handle, path, columnHandle, rect);
8f14e0
-				OS.gtk_tree_view_get_background_area (handle, path, columnHandle, clipRect);
8f14e0
 				OS.gtk_tree_path_free (path);
8f14e0
 				// A workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=459117
8f14e0
 				if (cr != 0 && OS.GTK_VERSION > OS.VERSION(3, 9, 0) && OS.GTK_VERSION <= OS.VERSION(3, 14, 8)) {
8f14e0
@@ -2877,12 +2873,9 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
8f14e0
 				gc.setFont (item.getFont (columnIndex));
8f14e0
 				if ((style & SWT.MIRRORED) != 0) {
8f14e0
 					rect.x = getClientWidth () - rect.width - rect.x;
8f14e0
-					clipRect.x = getClientWidth () - clipRect.width - clipRect.x;
8f14e0
 				}
8f14e0
 
8f14e0
-				if (!OS.GTK3){
8f14e0
-					gc.setClipping (clipRect.x, clipRect.y, clipRect.width, clipRect.height);
8f14e0
-				}
8f14e0
+				gc.setClipping (rect.x, rect.y, rect.width, rect.height);
8f14e0
 
8f14e0
 				Event event = new Event ();
8f14e0
 				event.item = item;
8f14e0
@@ -2893,9 +2886,7 @@ void rendererRender (long /*int*/ cell, long /*int*/ cr, long /*int*/ window, lo
8f14e0
 				event.width = contentWidth [0];
8f14e0
 				event.height = rect.height;
8f14e0
 				event.detail = drawState;
8f14e0
-				if (!OS.GTK3 || OS.GTK_VERSION > OS.VERSION(3, 14, 8)) {
8f14e0
-					sendEvent (SWT.PaintItem, event);
8f14e0
-				}
8f14e0
+				sendEvent(SWT.PaintItem, event);
8f14e0
 				gc.dispose();
8f14e0
 			}
8f14e0
 		}
8f14e0
-- 
8f14e0
cgit v0.11.2-4-g4a35
8f14e0