diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java index 7f571ce9e..1c09113f1 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XCreatorUtils.java @@ -28,6 +28,7 @@ import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.main.Form; import com.fr.form.main.WidgetGather; import com.fr.form.parameter.FormSubmitButton; +import com.fr.form.ui.AbstractBorderStyleWidget; import com.fr.form.ui.Button; import com.fr.form.ui.CardAddButton; import com.fr.form.ui.CardSwitchButton; @@ -232,7 +233,7 @@ public class XCreatorUtils { JTemplate template = HistoryTemplateListCache.getInstance().getCurrentEditingTemplate(); TemplateTheme theme = template.getTemplateTheme(); if (theme instanceof FormTheme) { - setupTemplateTheme(creator, (FormTheme) theme, TemplateThemeCompatible.NONE); + setupTemplateTheme(creator, true, (FormTheme) theme, TemplateThemeCompatible.NONE); } return creator; } @@ -378,12 +379,15 @@ public class XCreatorUtils { return null; } - public static void setupTemplateTheme(XCreator container, final FormTheme currentTemplateUsingTheme, TemplateThemeCompatible compatible) { + public static void setupTemplateTheme(XCreator container, final boolean forceFollowingTheme, final FormTheme currentTemplateUsingTheme, TemplateThemeCompatible compatible) { FineColorGather colorGather = new FineColorManager.FineColorReplaceByTheme(currentTemplateUsingTheme, compatible); Form.traversalWidget(container.toData(), new WidgetGather() { @Override public void dealWith(Widget widget) { TemplateThemeAware themedWidget = (TemplateThemeAware) widget; + if (forceFollowingTheme && widget instanceof AbstractBorderStyleWidget) { + ((AbstractBorderStyleWidget) widget).setBorderStyleFollowingTheme(true); + } themedWidget.onTemplateUsingThemeChange(currentTemplateUsingTheme, compatible); } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/ToolBarButton.java b/designer-form/src/main/java/com/fr/design/mainframe/ToolBarButton.java index 4c18ba475..53b9c5291 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/ToolBarButton.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/ToolBarButton.java @@ -99,7 +99,7 @@ public class ToolBarButton extends UIButton implements MouseListener, MouseMotio creatorSource = no.getNameOption().createWidget(); } if (creatorSource != null) { - XCreator xCreator = XCreatorUtils.createXCreator(creatorSource); + XCreator xCreator = XCreatorUtils.createThemedXCreator(creatorSource); WidgetToolBarPane.getTarget().startDraggingBean(xCreator); FormDesignerUtils.addWidgetProcessInfo(xCreator.toData()); lastPressEvent = null; diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java b/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java index 72418b86b..0dd613975 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/util/ShareComponentUtils.java @@ -61,7 +61,7 @@ public class ShareComponentUtils { boolean isCurrentUsingThemeSuitSharedComponent = StringUtils.isNotEmpty(theme.getName()) && StringUtils.isNotEmpty(suitableTemplateThemeName) && StringUtils.equals(theme.getName(), suitableTemplateThemeName); - XCreatorUtils.setupTemplateTheme(creator, (FormTheme) theme, isCurrentUsingThemeSuitSharedComponent ? TemplateThemeCompatible.NONE : TemplateThemeCompatible.ABSENT); + XCreatorUtils.setupTemplateTheme(creator, false, (FormTheme) theme, isCurrentUsingThemeSuitSharedComponent ? TemplateThemeCompatible.NONE : TemplateThemeCompatible.ABSENT); } return creator; }