Bug 519295: [GTK3] Invisible settings button in validation preferences

Instead of setting the image dimensions for each column, set them in the
parent and use those dimensions for every column. Every image renderer
should be the same size anyways, regardless of column -- the size is
determined by the dimensions of the first image set.

The bug was caused by parent.pixbufSizeSet being true, but the column
renderers being size 0x0. The renderers in the third column never got
sized because the column renderer size was never set. Funnily enough the
ability to check for this was added in Tree but never implemented. Both
Table and Tree have been fixed now.

Change-Id: Ibad077cb4de21071bb22b75446881d63da0590e0
Signed-off-by: Eric Williams <ericwill@redhat.com>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
index 0829166..dc1ff6f 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java
@@ -89,7 +89,7 @@
 	int maxWidth = 0;
 	int topIndex;
 	double cachedAdjustment, currentAdjustment;
-
+	int pixbufHeight, pixbufWidth;
 	static final int CHECKED_COLUMN = 0;
 	static final int GRAYED_COLUMN = 1;
 	static final int FOREGROUND_COLUMN = 2;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
index 9070e3d..c13e64d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TableItem.java
@@ -38,7 +38,6 @@
 	Font font;
 	Font[] cellFont;
 	boolean cached, grayed;
-	int columnSetHeight, columnSetWidth;
 
 /**
  * Constructs a new instance of this class given its parent
@@ -1174,9 +1173,9 @@
 				int iHeight = image.getBoundsInPixels ().height;
 				if (iWidth > currentWidth [0] || iHeight > currentHeight [0]) {
 					OS.gtk_cell_renderer_set_fixed_size (pixbufRenderer, iWidth, iHeight);
+					parent.pixbufHeight = iHeight;
+					parent.pixbufWidth = iWidth;
 					parent.pixbufSizeSet = true;
-					columnSetHeight = iHeight;
-					columnSetWidth = iWidth;
 				}
 			}
 		} else {
@@ -1186,8 +1185,8 @@
 			 * Bug 489025: There is a corner case where the below is triggered when current(Width|Height) is -1,
 			 * which results in icons being set to 0. Fix is to compare only positive sizes.
 			 */
-			if (columnSetWidth > Math.max(currentWidth [0], 0) || columnSetHeight > Math.max(currentHeight [0], 0)) {
-				OS.gtk_cell_renderer_set_fixed_size (pixbufRenderer, columnSetWidth, columnSetHeight);
+			if (parent.pixbufWidth > Math.max(currentWidth [0], 0) || parent.pixbufHeight > Math.max(currentHeight [0], 0)) {
+				OS.gtk_cell_renderer_set_fixed_size (pixbufRenderer, parent.pixbufWidth, parent.pixbufHeight);
 			}
 		}
 	}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
index 0bd2e4b..a3e0e87 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/TreeItem.java
@@ -40,7 +40,6 @@
 	Font[] cellFont;
 	boolean cached, grayed, isExpanded;
 	static final int EXPANDER_EXTRA_PADDING = 4;
-	int columnSetHeight, columnSetWidth;
 
 /**
  * Constructs a new instance of this class given its parent
@@ -1528,8 +1527,6 @@
 				if (iWidth > currentWidth [0] || iHeight > currentHeight [0]) {
 					OS.gtk_cell_renderer_set_fixed_size (pixbufRenderer, iWidth, iHeight);
 					parent.pixbufSizeSet = true;
-					columnSetHeight = iHeight;
-					columnSetWidth = iWidth;
 					parent.pixbufHeight = iHeight;
 					parent.pixbufWidth = iWidth;
 					/*
@@ -1558,8 +1555,8 @@
 			 * Bug 489025: There is a corner case where the below is triggered when current(Width|Height) is -1,
 			 * which results in icons being set to 0. Fix is to compare only positive sizes.
 			 */
-			if (columnSetWidth > Math.max(currentWidth [0], 0) || columnSetHeight > Math.max(currentHeight [0], 0)) {
-				OS.gtk_cell_renderer_set_fixed_size (pixbufRenderer, columnSetWidth, columnSetHeight);
+			if (parent.pixbufWidth > Math.max(currentWidth [0], 0) || parent.pixbufHeight > Math.max(currentHeight [0], 0)) {
+				OS.gtk_cell_renderer_set_fixed_size (pixbufRenderer, parent.pixbufWidth, parent.pixbufHeight);
 			}
 		}
 	}