summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT Theme
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-10-12 17:16:47 -0400
committerArun Thondapu <arunkumar.thondapu@in.ibm.com>2012-10-15 12:12:57 +0530
commit10f582427b55ec27f4cfe49dc45699d6a4b5a631 (patch)
tree0ac48aa50b7fbe69d2b175775100dfcecd8d72fc /bundles/org.eclipse.swt/Eclipse SWT Theme
parentb16cc7ac5911d04bae872f4c5c032f451e75a127 (diff)
downloadeclipse.platform.swt-10f582427b55ec27f4cfe49dc45699d6a4b5a631.tar.gz
eclipse.platform.swt-10f582427b55ec27f4cfe49dc45699d6a4b5a631.tar.xz
eclipse.platform.swt-10f582427b55ec27f4cfe49dc45699d6a4b5a631.zip
Use gtk_render_expander () instead of gtk_paint_expander () for GTK+ 3
This patch replaces gtk_paint_expander () with gtk_paint_expander () for GTK+3.
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Theme')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ExpanderDrawData.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ExpanderDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ExpanderDrawData.java
index 3f98b5077b..734df12873 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ExpanderDrawData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ExpanderDrawData.java
@@ -13,6 +13,7 @@ package org.eclipse.swt.internal.theme;
import org.eclipse.swt.*;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.internal.*;
+import org.eclipse.swt.internal.cairo.Cairo;
import org.eclipse.swt.internal.gtk.*;
public class ExpanderDrawData extends DrawData {
@@ -33,7 +34,14 @@ void draw(Theme theme, GC gc, Rectangle bounds) {
int expander_size = theme.getWidgetProperty(treeHandle, "expander-size");
int x = bounds.x + expander_size / 2;
int y = bounds.y + expander_size / 2;
- OS.gtk_paint_expander(gtkStyle, drawable, state_type, null, treeHandle, detail, x, y, expander_style);
+ if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ long /*int*/ cairo = OS.gdk_cairo_create (drawable);
+ long /*int*/ context = OS.gtk_widget_get_style_context (gtkStyle);
+ OS.gtk_render_expander (context, cairo, bounds.x, bounds.y, expander_size, expander_size);
+ Cairo.cairo_destroy (cairo);
+ } else {
+ OS.gtk_paint_expander(gtkStyle, drawable, state_type, null, treeHandle, detail, x, y, expander_style);
+ }
}
int hit(Theme theme, Point position, Rectangle bounds) {