summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeronika Irvine <veronika>2004-11-26 17:37:15 +0000
committerVeronika Irvine <veronika>2004-11-26 17:37:15 +0000
commit53589931c57a2758ce0fb761e62dab57822faf93 (patch)
tree186ba1df7baff9c79866128db9c7e45683d84e71
parentf54b8133c29f1d34c9380424243c20c77640c075 (diff)
downloadeclipse.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-xbundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashForm.java18
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));