Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2013-07-29 14:58:52 +0000
committerAlexander Kurtakov2013-08-20 11:12:46 +0000
commitaf26fb47121d2cbd444915b5211d92181e0faffa (patch)
tree406e7164c50c8915f4637fb83e787448441549a8
parent77cda7bb5c50dc454924d0137cd4202025717425 (diff)
downloadeclipse.platform.swt-af26fb47121d2cbd444915b5211d92181e0faffa.tar.gz
eclipse.platform.swt-af26fb47121d2cbd444915b5211d92181e0faffa.tar.xz
eclipse.platform.swt-af26fb47121d2cbd444915b5211d92181e0faffa.zip
Fix icons shading in Gtk3 Table and Tree items.
Done by using the gicon instead of pixbuf attribute. Bug: 404448 [GTK3] Images of disabled buttons are not grayed out Change-Id: I0209b814c77a96346914d12df41a621d19e3a657 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Tree.java4
3 files changed, 5 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
index 9391e231f0..7e282a9250 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java
@@ -607,6 +607,7 @@ public class OS extends C {
public static final byte[] model = ascii("model");
public static final byte[] spacing = ascii("spacing");
public static final byte[] pixbuf = ascii("pixbuf");
+ public static final byte[] gicon = ascii("gicon");
public static final byte[] text = ascii("text");
public static final byte[] xalign = ascii("xalign");
public static final byte[] ypad = ascii("ypad");
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 af72e9e527..cc364d5589 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
@@ -210,7 +210,7 @@ long /*int*/ cellDataProc (long /*int*/ tree_column, long /*int*/ cell, long /*i
ptr [0] = 0;
if (isPixbuf) {
OS.gtk_tree_model_get (tree_model, iter, modelIndex + CELL_PIXBUF, ptr, -1);
- OS.g_object_set (cell, OS.pixbuf, ptr [0], 0);
+ OS.g_object_set (cell, OS.GTK3 ? OS.gicon : OS.pixbuf, ptr [0], 0);
if (ptr [0] != 0) OS.g_object_unref (ptr [0]);
} else {
OS.gtk_tree_model_get (tree_model, iter, modelIndex + CELL_TEXT, ptr, -1);
@@ -801,7 +801,7 @@ void createRenderers (long /*int*/ columnHandle, int modelIndex, boolean check,
}
/* Add attributes */
- OS.gtk_tree_view_column_add_attribute (columnHandle, pixbufRenderer, OS.pixbuf, modelIndex + CELL_PIXBUF);
+ OS.gtk_tree_view_column_add_attribute (columnHandle, pixbufRenderer, OS.GTK3 ? OS.gicon : OS.pixbuf, modelIndex + CELL_PIXBUF);
if (!ownerDraw) {
OS.gtk_tree_view_column_add_attribute (columnHandle, pixbufRenderer, OS.cell_background_gdk, BACKGROUND_COLUMN);
OS.gtk_tree_view_column_add_attribute (columnHandle, textRenderer, OS.cell_background_gdk, BACKGROUND_COLUMN);
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 f7c4856be3..58a00dd1be 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
@@ -255,7 +255,7 @@ long /*int*/ cellDataProc (long /*int*/ tree_column, long /*int*/ cell, long /*i
if (isPixbuf) {
ptr [0] = 0;
OS.gtk_tree_model_get (tree_model, iter, modelIndex + CELL_PIXBUF, ptr, -1);
- OS.g_object_set (cell, OS.pixbuf, ptr[0], 0);
+ OS.g_object_set (cell, OS.GTK3 ? OS.gicon : OS.pixbuf, ptr [0], 0);
if (ptr [0] != 0) OS.g_object_unref (ptr [0]);
} else {
ptr [0] = 0;
@@ -900,7 +900,7 @@ void createRenderers (long /*int*/ columnHandle, int modelIndex, boolean check,
}
/* Add attributes */
- OS.gtk_tree_view_column_add_attribute (columnHandle, pixbufRenderer, OS.pixbuf, modelIndex + CELL_PIXBUF);
+ OS.gtk_tree_view_column_add_attribute (columnHandle, pixbufRenderer, OS.GTK3 ? OS.gicon : OS.pixbuf, modelIndex + CELL_PIXBUF);
if (!ownerDraw) {
OS.gtk_tree_view_column_add_attribute (columnHandle, pixbufRenderer, OS.cell_background_gdk, BACKGROUND_COLUMN);
OS.gtk_tree_view_column_add_attribute (columnHandle, textRenderer, OS.cell_background_gdk, BACKGROUND_COLUMN);

Back to the top