Bug 489025 - [mylyn][gtk3] Task list does not show task icon
Icons were not rendered on first load.
The cause was some renderers were set to -1x-1 on first load,
which triggered some renderers to be set 0x0 instead of
initial size. The fix is compare to max(size, 0).
Change-Id: I6f3ba20259dc949c97ca475b8c87cae96636dcc3
Signed-off-by: Lev Ufimtsev <lufimtse@redhat.com>
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 b44f2a9..6e0d931 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
@@ -1179,8 +1179,10 @@
/*
* We check to see if the cached value is greater than the size of the pixbufRenderer.
* If it is, then we change the size of the pixbufRenderer accordingly.
+ * 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 > currentWidth [0] || columnSetHeight > currentHeight [0]) {
+ if (columnSetWidth > Math.max(currentWidth [0], 0) || columnSetHeight > Math.max(currentHeight [0], 0)) {
OS.gtk_cell_renderer_set_fixed_size (pixbufRenderer, columnSetWidth, columnSetHeight);
}
}
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 5247366..3c3e80e 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
@@ -1547,10 +1547,12 @@
}
} else {
/*
- * We check to see if the cached value is greater than the size of the pixbufRenderer.
+ * Bug 483112: We check to see if the cached value is greater than the size of the pixbufRenderer.
* If it is, then we change the size of the pixbufRenderer accordingly.
+ * 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 > currentWidth [0] || columnSetHeight > currentHeight [0]) {
+ if (columnSetWidth > Math.max(currentWidth [0], 0) || columnSetHeight > Math.max(currentHeight [0], 0)) {
OS.gtk_cell_renderer_set_fixed_size (pixbufRenderer, columnSetWidth, columnSetHeight);
}
}