aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSravan Kumar Lakkimsetti2014-04-30 02:01:18 (EDT)
committerAlexander Kurtakov2014-05-02 03:01:32 (EDT)
commita43c04c97ceffe2b12039d4c052d72e59a0568dd (patch)
treedf106a5407ef127fc16e65180f397dd94730494c
parent8438283a725bc5f93b9be3be9ab4375b68555cb2 (diff)
downloadeclipse.platform.swt-a43c04c97ceffe2b12039d4c052d72e59a0568dd.zip
eclipse.platform.swt-a43c04c97ceffe2b12039d4c052d72e59a0568dd.tar.gz
eclipse.platform.swt-a43c04c97ceffe2b12039d4c052d72e59a0568dd.tar.bz2
Bug 422316 - [GTK3] No "icon" in TreeViewer for threads in "Debug" viewrefs/changes/65/25765/2
Change-Id: I089f2b87193abc849e7406eff1c5d04ba3a8f2e6 Signed-off-by: Sravan Kumar Lakkimsetti <sravankumarl@in.ibm.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java9
2 files changed, 16 insertions, 2 deletions
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 f1f4441..1d8df7e 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
@@ -756,7 +756,14 @@ void createRenderers (long /*int*/ columnHandle, int modelIndex, boolean check,
}
}
long /*int*/ pixbufRenderer = ownerDraw ? OS.g_object_new (display.gtk_cell_renderer_pixbuf_get_type (), 0) : OS.gtk_cell_renderer_pixbuf_new ();
- if (pixbufRenderer == 0) error (SWT.ERROR_NO_HANDLES);
+ if (pixbufRenderer == 0) {
+ error (SWT.ERROR_NO_HANDLES);
+ } else {
+ // set default size this size is used for calculating the icon and text positions in a table
+ if ((!ownerDraw) && (OS.GTK3)) {
+ OS.gtk_cell_renderer_set_fixed_size(pixbufRenderer, 16, 16);
+ }
+ }
long /*int*/ textRenderer = ownerDraw ? OS.g_object_new (display.gtk_cell_renderer_text_get_type (), 0) : OS.gtk_cell_renderer_text_new ();
if (textRenderer == 0) error (SWT.ERROR_NO_HANDLES);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
index e61b299..ef9df24 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java
@@ -856,7 +856,14 @@ void createRenderers (long /*int*/ columnHandle, int modelIndex, boolean check,
}
}
long /*int*/ pixbufRenderer = ownerDraw ? OS.g_object_new (display.gtk_cell_renderer_pixbuf_get_type (), 0) : OS.gtk_cell_renderer_pixbuf_new ();
- if (pixbufRenderer == 0) error (SWT.ERROR_NO_HANDLES);
+ if (pixbufRenderer == 0) {
+ error (SWT.ERROR_NO_HANDLES);
+ } else {
+ // set default size this size is used for calculating the icon and text positions in a tree
+ if ((!ownerDraw) && (OS.GTK3)) {
+ OS.gtk_cell_renderer_set_fixed_size(pixbufRenderer, 16, 16);
+ }
+ }
long /*int*/ textRenderer = ownerDraw ? OS.g_object_new (display.gtk_cell_renderer_text_get_type (), 0) : OS.gtk_cell_renderer_text_new ();
if (textRenderer == 0) error (SWT.ERROR_NO_HANDLES);