aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti2013-03-21 11:02:01 (EDT)
committerCarolyn MacLeod2013-04-09 10:56:48 (EDT)
commit2e524dc8338b33826e618d4102364265211694a8 (patch)
tree0e57253026c7e15fc7d85e16c62aeec4e9406ac3
parent3c7f2e403fb54ff1168c489a9c2c406b324d6e6c (diff)
downloadeclipse.platform.swt-2e524dc8338b33826e618d4102364265211694a8.zip
eclipse.platform.swt-2e524dc8338b33826e618d4102364265211694a8.tar.gz
eclipse.platform.swt-2e524dc8338b33826e618d4102364265211694a8.tar.bz2
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.java1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java15
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 567d22c..3936921 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 c6bad65..ea5b028 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));