diff options
author | Silenio Quarti | 2013-03-21 15:02:01 +0000 |
---|---|---|
committer | Carolyn MacLeod | 2013-04-09 14:56:48 +0000 |
commit | 2e524dc8338b33826e618d4102364265211694a8 (patch) | |
tree | 0e57253026c7e15fc7d85e16c62aeec4e9406ac3 | |
parent | 3c7f2e403fb54ff1168c489a9c2c406b324d6e6c (diff) | |
download | eclipse.platform.swt-2e524dc8338b33826e618d4102364265211694a8.tar.gz eclipse.platform.swt-2e524dc8338b33826e618d4102364265211694a8.tar.xz eclipse.platform.swt-2e524dc8338b33826e618d4102364265211694a8.zip |
Bug 399547 - [GTK3] Widget.getStyle() does not report a set SWT.BORDER value
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java | 1 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java | 15 |
2 files changed, 13 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java index 567d22c656..3936921566 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/org/eclipse/swt/internal/gtk/OS.java @@ -567,6 +567,7 @@ public class OS extends C { public static final byte[] GTK_STYLE_CLASS_VIEW = ascii("view"); public static final byte[] GTK_STYLE_CLASS_CELL = ascii("cell"); public static final byte[] GTK_STYLE_CLASS_PANE_SEPARATOR = ascii("pane-separator"); + public static final byte[] GTK_STYLE_CLASS_FRAME = ascii("frame"); /** Properties */ public static final byte[] active = ascii("active"); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java index c6bad65b1d..ea5b02892a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java @@ -2879,10 +2879,19 @@ public boolean getVisible () { Point getThickness (long /*int*/ widget) { if (OS.GTK3) { - GtkBorder padding = new GtkBorder(); + int xthickness = 0, ythickness = 0; + GtkBorder tmp = new GtkBorder(); long /*int*/ context = OS.gtk_widget_get_style_context (widget); - OS.gtk_style_context_get_padding (context, OS.GTK_STATE_FLAG_NORMAL, padding); - return new Point (padding.left, padding.top); + OS.gtk_style_context_save (context); + OS.gtk_style_context_add_class (context, OS.GTK_STYLE_CLASS_FRAME); + OS.gtk_style_context_get_padding (context, OS.GTK_STATE_FLAG_NORMAL, tmp); + xthickness += tmp.left; + ythickness += tmp.top; + OS.gtk_style_context_get_border (context, OS.GTK_STATE_FLAG_NORMAL, tmp); + xthickness += tmp.left; + ythickness += tmp.top; + OS.gtk_style_context_restore (context); + return new Point (xthickness, ythickness); } long /*int*/ style = OS.gtk_widget_get_style (widget); return new Point (OS.gtk_style_get_xthickness (style), OS.gtk_style_get_ythickness (style)); |