summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk
diff options
context:
space:
mode:
authorSilenio Quarti <silenio_quarti@ca.ibm.com>2013-03-21 11:02:01 -0400
committerSilenio Quarti <silenio_quarti@ca.ibm.com>2013-03-21 11:02:01 -0400
commita41e15e7547760b92fd60ae3e7e3c9081f82f745 (patch)
tree8c7fd0e69f305d8ae0172f39c46834123a6facfd /bundles/org.eclipse.swt/Eclipse SWT/gtk
parentaaca3a8c132e0c66e5c82fa0b5fdd8b7dddca88a (diff)
downloadeclipse.platform.swt-a41e15e7547760b92fd60ae3e7e3c9081f82f745.tar.gz
eclipse.platform.swt-a41e15e7547760b92fd60ae3e7e3c9081f82f745.tar.xz
eclipse.platform.swt-a41e15e7547760b92fd60ae3e7e3c9081f82f745.zip
Bug 399547 - [GTK3] Widget.getStyle() does not report a set SWT.BORDER value
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java15
1 files changed, 12 insertions, 3 deletions
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));