summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2008-09-03 21:10:26 +0000
committerFelipe Heidrich <fheidric>2008-09-03 21:10:26 +0000
commit9ba6f361f7d26988a03acffaa1292bf50dfb858c (patch)
tree0950d3b56969565cf2090f611f995108f5da23f3 /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java
parentbe204d185d5f45f6be9699beb03c60cb857f3694 (diff)
downloadeclipse.platform.swt-9ba6f361f7d26988a03acffaa1292bf50dfb858c.tar.gz
eclipse.platform.swt-9ba6f361f7d26988a03acffaa1292bf50dfb858c.tar.xz
eclipse.platform.swt-9ba6f361f7d26988a03acffaa1292bf50dfb858c.zip
Bug 139070 - ExpandBar draws on top of scrollbars
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java
index 91dfb8d0d1..6b0246b5e0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ExpandItem.java
@@ -409,6 +409,21 @@ void resizeControl (int yScroll) {
OS.gtk_widget_style_get (handle, OS.focus_line_width, property, 0);
y += property [0] * 2;
height -= property [0] * 2;
+
+ /*
+ * Feature in GTK. When the ExpandBar is resize too small the control
+ * shows up on top of the vertical scrollbar. This happen because the
+ * GtkExpander does not set the size of child smaller than the request
+ * size of its parent and because the control is not parented in the
+ * hierarchy of the GtkScrolledWindow.
+ * The fix is calculate the width ourselves when the scrollbar is visible.
+ */
+ ScrollBar vBar = parent.verticalBar;
+ if (vBar != null) {
+ if (OS.GTK_WIDGET_VISIBLE (vBar.handle)) {
+ width = OS.GTK_WIDGET_WIDTH (parent.scrolledHandle) - parent.vScrollBarWidth () - 2 * parent.spacing;
+ }
+ }
control.setBounds (x, y - yScroll, width, Math.max (0, height), true, true);
}
}