diff options
author | Silenio Quarti <silenio> | 2005-05-11 22:01:39 +0000 |
---|---|---|
committer | Silenio Quarti <silenio> | 2005-05-11 22:01:39 +0000 |
commit | fd611b15b7bd11db3dc2098327a6782e1a297e3e (patch) | |
tree | 30dd22f5b06763c4fa4e90860727d18b7eefffb1 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java | |
parent | e59050e0b8b9b37b8c9bb25c4df93fcaa4d59c08 (diff) | |
download | eclipse.platform.swt-fd611b15b7bd11db3dc2098327a6782e1a297e3e.tar.gz eclipse.platform.swt-fd611b15b7bd11db3dc2098327a6782e1a297e3e.tar.xz eclipse.platform.swt-fd611b15b7bd11db3dc2098327a6782e1a297e3e.zip |
94546
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java')
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java index f967e9e5a3..df81e20bdc 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java @@ -507,7 +507,9 @@ int /*long*/ gtk_clicked (int /*long*/ widget) { int /*long*/ gtk_enter_notify_event (int /*long*/ widget, int /*long*/ event) { drawHotImage = (parent.style & SWT.FLAT) != 0 && hotImage != null; if (drawHotImage && imageHandle != 0) { - OS.gtk_image_set_from_pixmap (imageHandle, hotImage.pixmap, hotImage.mask); + ImageList imageList = parent.imageList; + int /*long*/ pixbuf = imageList.getPixbuf (imageList.indexOf (hotImage)); + OS.gtk_image_set_from_pixbuf (imageHandle, pixbuf); } return 0; } @@ -538,7 +540,9 @@ int /*long*/ gtk_leave_notify_event (int /*long*/ widget, int /*long*/ event) { if (drawHotImage) { drawHotImage = false; if (imageHandle != 0 && image != null) { - OS.gtk_image_set_from_pixmap (imageHandle, image.pixmap, image.mask); + ImageList imageList = parent.imageList; + int /*long*/ pixbuf = imageList.getPixbuf (imageList.indexOf (image)); + OS.gtk_image_set_from_pixbuf (imageHandle, pixbuf); } } return 0; @@ -807,6 +811,16 @@ public void setHotImage (Image image) { checkWidget(); if ((style & SWT.SEPARATOR) != 0) return; hotImage = image; + if (image != null) { + ImageList imageList = parent.imageList; + if (imageList == null) imageList = parent.imageList = new ImageList (); + int imageIndex = imageList.indexOf (image); + if (imageIndex == -1) { + imageIndex = imageList.add (image); + } else { + imageList.put (imageIndex, image); + } + } } public void setImage (Image image) { |