summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT Theme
diff options
context:
space:
mode:
authorAnatoly Spektor <aspektor@redhat.com>2012-10-05 14:43:48 -0400
committerAlexander Kurtakov <akurtako@redhat.com>2012-10-05 22:08:46 +0300
commit077815f21f4c006f679f782063ec7af635ece7f2 (patch)
treea2d29b2f11e773f6a8a04d6151f0d4fad9bcb14f /bundles/org.eclipse.swt/Eclipse SWT Theme
parent62c688e769f9a74f3b48ecff0633da531ba422d6 (diff)
downloadeclipse.platform.swt-077815f21f4c006f679f782063ec7af635ece7f2.tar.gz
eclipse.platform.swt-077815f21f4c006f679f782063ec7af635ece7f2.tar.xz
eclipse.platform.swt-077815f21f4c006f679f782063ec7af635ece7f2.zip
Use gtk_render_focus instead of gtk_paint_focus 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.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/DrawData.java17
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolItemDrawData.java2
3 files changed, 19 insertions, 2 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 a414103e31..10a43a55b4 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
@@ -204,7 +204,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) {
y += child_displacement_y;
}
- OS.gtk_paint_focus(gtkStyle, drawable, state_type, null, buttonHandle, detail, x, y, width, height);
+ gtk_render_focus (gtkStyle, drawable, state_type, null, buttonHandle, detail, x, y, width, height);
}
if (clientArea != null) {
clientArea.x = bounds.x + border_width;
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 7156184b0f..0888aaf3d2 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
@@ -224,4 +224,21 @@ void gtk_render_layout (long /*int*/ style, long /*int*/ window, int state_type,
}
}
+void gtk_render_focus (long /*int*/ style, long /*int*/ window, int state_type, GdkRectangle area, long /*int*/ widget, byte[] detail, int x , int y, int width, int height) {
+ if (OS.GTK_VERSION >= OS.VERSION(3, 2, 0)) {
+ long /*int*/ cairo = OS.gdk_cairo_create (window);
+ long /*int*/ context = OS.gtk_widget_get_style_context (style);
+ OS.gtk_style_context_save (context);
+ OS.gtk_style_context_set_state (context, OS.gtk_widget_get_state_flags (widget));
+ Cairo.cairo_save (cairo);
+ OS.gtk_render_focus(context, cairo, x, y, width, height);
+ Cairo.cairo_restore (cairo);
+ OS.gtk_style_context_restore (context);
+ Cairo.cairo_destroy (cairo);
+
+ } else {
+ OS.gtk_paint_focus (style, window, state_type, area, widget, detail, x, y, width, height);
+ }
+}
+
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolItemDrawData.java b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolItemDrawData.java
index a590c4bb46..adb13f8c95 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolItemDrawData.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Theme/gtk/org/eclipse/swt/internal/theme/ToolItemDrawData.java
@@ -157,7 +157,7 @@ void draw(Theme theme, GC gc, Rectangle bounds) {
y += child_displacement_y;
}
- OS.gtk_paint_focus(gtkStyle, drawable, state_type, null, buttonHandle, detail, x, y, width, height);
+ gtk_render_focus (gtkStyle, drawable, state_type, null, buttonHandle, detail, x, y, width, height);
}
}