diff options
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.java | 15 |
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); } } |