summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT Theme
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-10-05 16:42:21 -0400
committerAlexander Kurtakov <akurtako@redhat.com>2012-10-08 13:40:11 +0300
commit978b038415c514f70919a32aaf716830349ff52c (patch)
treebe347f023e1fc526e11204ea2a399fad1d2acb89 /bundles/org.eclipse.swt/Eclipse SWT Theme
parent4c1263d1098452f842fef4a42a3943e350fb9b23 (diff)
downloadeclipse.platform.swt-978b038415c514f70919a32aaf716830349ff52c.tar.gz
eclipse.platform.swt-978b038415c514f70919a32aaf716830349ff52c.tar.xz
eclipse.platform.swt-978b038415c514f70919a32aaf716830349ff52c.zip
Use gtk_render_check instead of gtk_paint_check 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/ButtonDrawData.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java
index 10a43a55b4..a457f381cf 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ButtonDrawData.java
@@ -111,7 +111,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) {
gtk_render_frame (gtkStyle, drawable, OS.GTK_STATE_PRELIGHT, OS.GTK_SHADOW_ETCHED_OUT, null, checkButtonHandle, detail, prelight_x, prelight_y, prelight_width, prelight_height);
}
int state_type = getStateType(DrawData.WIDGET_WHOLE);
- OS.gtk_paint_check(gtkStyle, drawable, state_type, shadow_type, null, checkButtonHandle, detail, x, y, indicator_size, indicator_size);
+ gtk_render_check (gtkStyle, drawable, state_type, shadow_type, checkButtonHandle, detail, x, y, indicator_size, indicator_size);
if (clientArea != null) {
clientArea.x = bounds.x + 2 * indicator_spacing + border_width + indicator_size;
clientArea.y = bounds.y + border_width;
@@ -231,4 +231,15 @@ void gtk_render_option (long /*int*/ style, long /*int*/ window, int state_type,
}
}
+void gtk_render_check(long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, long /*int*/ widget, byte[] detail, int x , int y, int width, int height) {
+ if (OS.GTK_VERSION >= OS.VERSION(3, 0, 0)) {
+ long /*int*/ cairo = OS.gdk_cairo_create(window);
+ long /*int*/ context = OS.gtk_widget_get_style_context (style);
+ OS.gtk_render_check(context, cairo, context, y, width, height);
+ Cairo.cairo_destroy (cairo);
+ } else {
+ OS.gtk_paint_check(style, window, state_type, shadow_type, null, widget, detail, x, y, width, height);
+ }
+}
+
}