Browse Source

REPORT-58073 【主题切换】细节定制-FRM组件样式-标题配置后点击保存,并未联动变化

【问题原因】
刷新时在XWTitleLayout中重置标题样式

【改动思路】
同上
research/11.0
Starryi 3 years ago
parent
commit
1b341a30fe
  1. 11
      designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java

11
designer-form/src/main/java/com/fr/design/designer/creator/XWTitleLayout.java

@ -219,17 +219,26 @@ public class XWTitleLayout extends DedicateLayoutContainer {
public void convert() { public void convert() {
isRefreshing = true; isRefreshing = true;
WTitleLayout layout = this.toData(); WTitleLayout layout = this.toData();
XBorderStyleWidgetCreator bodyCreator = null;
this.removeAll(); this.removeAll();
for (int i = 0, num = layout.getWidgetCount(); i < num; i++) { for (int i = 0, num = layout.getWidgetCount(); i < num; i++) {
BoundsWidget bw = (BoundsWidget) layout.getWidget(i); BoundsWidget bw = (BoundsWidget) layout.getWidget(i);
if (bw != null) { if (bw != null) {
Rectangle bounds = bw.getBounds(); Rectangle bounds = bw.getBounds();
XWidgetCreator comp = (XWidgetCreator) XCreatorUtils.createXCreator(bw.getWidget()); XWidgetCreator comp = (XWidgetCreator) XCreatorUtils.createXCreator(bw.getWidget());
String constraint = bw.getWidget().acceptType(Label.class) ? WTitleLayout.TITLE : WTitleLayout.BODY; boolean isTitleWidget = bw.getWidget().acceptType(Label.class);
String constraint = isTitleWidget ? WTitleLayout.TITLE : WTitleLayout.BODY;
this.add(comp, constraint); this.add(comp, constraint);
comp.setBounds(bounds); comp.setBounds(bounds);
if (!isTitleWidget && comp instanceof XBorderStyleWidgetCreator) {
bodyCreator = (XBorderStyleWidgetCreator) comp;
}
} }
} }
// 刷新时重置下样式
if (bodyCreator != null) {
bodyCreator.initStyle();
}
isRefreshing = false; isRefreshing = false;
} }

Loading…
Cancel
Save