if (control != null && !control.isDisposed()) {
if (visible) {
FormData fd = (FormData) control.getLayoutData();
fd.width = 0;
fd.height = 0;
control.setData("oldSize", new Point(0, 0));
skinObject.setVisible(visible);
// FormData should now be 0,0, but setVisible may have
// explicitly changed it
fd = (FormData) control.getLayoutData();
if (fd.width != 0 || fd.height != 0) {
return;
}
if (destSize != null) {
if (fd != null
&& (fd.width != destSize.x || fd.height != destSize.y)) {
if (fast) {
fd.width = destSize.x;
fd.height = destSize.y;
control.setLayoutData(fd);
Utils.relayout(control);
} else {
slide(skinObject, fd, destSize, runAfterSlide);
runAfterSlide = null; // prevent calling again
}
}
} else {
if (fd.width == 0) {
fd.width = SWT.DEFAULT;
}
if (fd.height == 0) {
fd.height = SWT.DEFAULT;
}
control.setLayoutData(fd);
Utils.relayout(control);
}
control.setData("v3.oldHeight", null);
} else {
final FormData fd = (FormData) control.getLayoutData();
if (fd != null) {
Point oldSize = new Point(fd.width, fd.height);
if (oldSize.y <= 0) {
oldSize = null;
}
control.setData("v3.oldHeight", oldSize);