diff options
author | Anatoly Spektor <aspektor@redhat.com> | 2012-10-04 13:53:15 -0400 |
---|---|---|
committer | Alexander Kurtakov <akurtako@redhat.com> | 2012-10-04 22:25:27 +0300 |
commit | 3fdc19a025bdb1d1c9714427e7323556f1c5dd33 (patch) | |
tree | 878dc1e3e55e146f7f52e4741b5f9a28216b5e33 /bundles/org.eclipse.swt/Eclipse SWT Theme | |
parent | 9004816c0eded49a87ffaf370b4fefa4dbb6d38b (diff) | |
download | eclipse.platform.swt-3fdc19a025bdb1d1c9714427e7323556f1c5dd33.tar.gz eclipse.platform.swt-3fdc19a025bdb1d1c9714427e7323556f1c5dd33.tar.xz eclipse.platform.swt-3fdc19a025bdb1d1c9714427e7323556f1c5dd33.zip |
Use gtk_render_frame instead of gtk_paint_flat_box for GTK+ 3 and higher.
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Theme')
3 files changed, 15 insertions, 3 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 6510a285e8..9176d5cbb8 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 @@ -60,7 +60,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) { prelight_y = bounds.y + border_width; prelight_width = bounds.width - (2 * border_width); prelight_height = bounds.height - (2 * border_width); - OS.gtk_paint_flat_box(gtkStyle, drawable, OS.GTK_STATE_PRELIGHT, OS.GTK_SHADOW_ETCHED_OUT, null, radioButtonHandle, detail, prelight_x, prelight_y, prelight_width, prelight_height); + gtk_render_frame (gtkStyle, drawable, OS.GTK_STATE_PRELIGHT, OS.GTK_SHADOW_ETCHED_OUT, null, radioButtonHandle, detail, prelight_x, prelight_y, prelight_width, prelight_height); } int state_type = getStateType(DrawData.WIDGET_WHOLE); OS.gtk_paint_option(gtkStyle, drawable, state_type, shadow_type, null, radioButtonHandle, detail, x, y, indicator_size, indicator_size); @@ -107,7 +107,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) { prelight_y = bounds.y + border_width; prelight_width = bounds.width - (2 * border_width); prelight_height = bounds.height - (2 * border_width); - OS.gtk_paint_flat_box(gtkStyle, drawable, OS.GTK_STATE_PRELIGHT, OS.GTK_SHADOW_ETCHED_OUT, null, checkButtonHandle, detail, prelight_x, prelight_y, prelight_width, prelight_height); + 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); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ComboDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ComboDrawData.java index 7669e9fa79..dfe64201a5 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ComboDrawData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ComboDrawData.java @@ -77,7 +77,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) { width -= 2 * xthickness; height -= 2 * ythickness; detail = Converter.wcsToMbcs(null, "entry_bg", true); - OS.gtk_paint_flat_box(gtkStyle, drawable, state_type, OS.GTK_SHADOW_NONE, null, entryHandle, detail, x, y, width - arrow_button_width, height); + gtk_render_frame (gtkStyle, drawable, state_type, OS.GTK_SHADOW_NONE, null, entryHandle, detail, x, y, width - arrow_button_width, height); if (clientArea != null) { clientArea.x = x; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java index f51bdc1c13..f2539a349f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java @@ -12,6 +12,7 @@ package org.eclipse.swt.internal.theme; 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 DrawData { @@ -188,4 +189,15 @@ Rectangle measureText(Theme theme, String text, int flags, GC gc, Rectangle boun return new Rectangle(0, 0, OS.PANGO_PIXELS(width[0]), OS.PANGO_PIXELS(height[0])); } +void gtk_render_frame (long /*int*/ style, long /*int*/ window, int state_type, int shadow_type, GdkRectangle area, 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_frame (context, cairo, context, y, width, height); + Cairo.cairo_destroy (cairo); + } else { + OS.gtk_paint_flat_box (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height); + } +} + } |