From d20287fc0028770d688fd3fc76eadc9c310edecb Mon Sep 17 00:00:00 2001 From: Anatoly Spektor Date: Fri, 5 Oct 2012 13:54:10 -0400 Subject: Use gtk_render_frame_gap instead of gtk_paint_box_gap for GTK+ 3 --- .../org/eclipse/swt/internal/theme/TabFolderDrawData.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme') diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabFolderDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabFolderDrawData.java index 84cabdfd04..8925d453a4 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabFolderDrawData.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/TabFolderDrawData.java @@ -13,6 +13,7 @@ package org.eclipse.swt.internal.theme; import org.eclipse.swt.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 TabFolderDrawData extends DrawData { @@ -44,7 +45,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) { y += tabsHeight; } byte[] detail = Converter.wcsToMbcs(null, "notebook", true); - OS.gtk_paint_box_gap(gtkStyle, drawable, getStateType(DrawData.WIDGET_WHOLE), OS.GTK_SHADOW_OUT, null, notebookHandle, detail, x, y, width, height, gap_side, gap_x, gap_width); + gtk_render_frame_gap (gtkStyle, drawable, getStateType(DrawData.WIDGET_WHOLE), OS.GTK_SHADOW_OUT, null, notebookHandle, detail, x, y, width, height, gap_side, gap_x, gap_width); if (tabsArea != null) { tabsArea.x = bounds.x; tabsArea.y = bounds.y; @@ -64,4 +65,15 @@ int hit(Theme theme, Point position, Rectangle bounds) { return bounds.contains(position) ? DrawData.WIDGET_WHOLE : DrawData.WIDGET_NOWHERE; } +void gtk_render_frame_gap (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, int gap_side, int gap_x, int gap_width) { + 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_gap (context, cairo, context, y, gap_width, height, gap_side, gap_x, gap_x + gap_width); + Cairo.cairo_destroy (cairo); + } else { + OS.gtk_paint_box_gap (style, window, state_type, shadow_type, area, widget, detail, x, y, width, height, gap_side, gap_x, gap_width); + } +} + } -- cgit