Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2013-07-29 14:58:52 +0000
committerGerrit Code Review @ Eclipse.org2013-07-30 18:06:17 +0000
commit9a41049842260567fdbda8010098000382026861 (patch)
treec5dab3d618ef5f9d708b5e1284b65f296ad433c7
parentcf7558133e9e953c3fd81604968f20b582949c42 (diff)
downloadeclipse.platform.swt-9a41049842260567fdbda8010098000382026861.tar.gz
eclipse.platform.swt-9a41049842260567fdbda8010098000382026861.tar.xz
eclipse.platform.swt-9a41049842260567fdbda8010098000382026861.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 722ebee19b..750f49cf91 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 739e271191..0bc3024d3c 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);
@@ -773,7 +773,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 beec23ac4f..9472527116 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;
@@ -872,7 +872,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