diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java index 25bd5749f9..5d651aa021 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormDesigner.java @@ -1010,15 +1010,7 @@ public class FormDesigner extends TargetComponent
implements TreeSelection } private void refreshCenter(Widget centerWidget, XLayoutContainer formLayoutContainer) { - // 不存在center块, 说明是新建的模板 - if (centerWidget == null) { - XLayoutContainer layoutContainer = (XLayoutContainer) XCreatorUtils.createXCreator(new WFitLayout("body")); - layoutContainer.setSize(LARGE_PREFERRED_SIZE); - setRootComponent(layoutContainer); - formLayoutContainer.add(rootComponent, WBorderLayout.CENTER); - return; - } - + // 不存在center块, 说明是新建的模板(fanglei:大人,时代变了) XLayoutContainer centerContainer = (XLayoutContainer) XCreatorUtils.createXCreator(centerWidget); Dimension d = new Dimension(); d.width = ((WFitLayout) centerWidget).getContainerWidth(); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java index 8ca985ef3a..dfa156d5e1 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java @@ -294,7 +294,9 @@ public class NewFormPane extends BasicPane { } private Form initEmptyBodyForm() { - WFitLayout body = new WFitLayout(); + WFitLayout body = new WFitLayout("body"); + body.setContainerWidth(WBorderLayout.DEFAULT_WIDTH); + body.setContainerHeight(WBorderLayout.DEFAULT_HEIGHT); WBorderLayout borderLayout = new WBorderLayout("form"); borderLayout.addCenter(body); return new Form(borderLayout);