diff options
author | Veronika Irvine <veronika> | 2004-11-26 17:37:15 +0000 |
---|---|---|
committer | Veronika Irvine <veronika> | 2004-11-26 17:37:15 +0000 |
commit | 53589931c57a2758ce0fb761e62dab57822faf93 (patch) | |
tree | 186ba1df7baff9c79866128db9c7e45683d84e71 | |
parent | f54b8133c29f1d34c9380424243c20c77640c075 (diff) | |
download | eclipse.platform.swt-53589931c57a2758ce0fb761e62dab57822faf93.tar.gz eclipse.platform.swt-53589931c57a2758ce0fb761e62dab57822faf93.tar.xz eclipse.platform.swt-53589931c57a2758ce0fb761e62dab57822faf93.zip |
bug 79481 - stop resize of sashes if style is SWT.SMOOTH
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashForm.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashForm.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashForm.java index 7dbd03751a..3cedb7f0ae 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashForm.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashForm.java @@ -157,16 +157,16 @@ Control[] getControls(boolean onlyVisible) { return result; } void onDragSash(Event event) { - if (event.detail == SWT.DRAG) { - // constrain feedback - Rectangle area = getClientArea(); - if (getOrientation() == SWT.HORIZONTAL) { + if (event.detail == SWT.DRAG) { + // constrain feedback + Rectangle area = getClientArea(); + if (getOrientation() == SWT.HORIZONTAL) { event.x = Math.min(Math.max(DRAG_MINIMUM, event.x), area.width - DRAG_MINIMUM - SASH_WIDTH); - } else { + } else { event.y = Math.min(Math.max(DRAG_MINIMUM, event.y), area.height - DRAG_MINIMUM - SASH_WIDTH); - } - return; - } + } + return; + } Sash sash = (Sash)event.widget; int sashIndex = -1; @@ -191,6 +191,7 @@ void onDragSash(Event event) { b2.x += shift; b2.width -= shift; if (b1.width < DRAG_MINIMUM || b2.width < DRAG_MINIMUM) { + event.doit = false; return; } c1.setData(LAYOUT_RATIO, new Long((((long)b1.width << 16) + area.width - 1) / area.width)); @@ -201,6 +202,7 @@ void onDragSash(Event event) { b2.y += shift; b2.height -= shift; if (b1.height < DRAG_MINIMUM || b2.height < DRAG_MINIMUM) { + event.doit = false; return; } c1.setData(LAYOUT_RATIO, new Long((((long)b1.height << 16) + area.height - 1) / area.height)); |