Browse Source

Merge pull request #6907 in DESIGN/design from bugfix/10.0 to feature/10.0

* commit 'ad9569f781fcc6e66b3f4f36ef281dd3088107cd':
  REPORT-63310 已保存的无边框tab块在绝对布局内调整组件大小后,自动生成了默认黑色边框 & REPORT-59963 调整Tab块样式会导致Tab标题背景色重置
feature/10.0
superman 3 years ago
parent
commit
18ca498021
  1. 18
      designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java
  2. 18
      designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutStylePane.java

18
designer-form/src/main/java/com/fr/design/designer/creator/cardlayout/XWCardLayout.java

@ -62,10 +62,6 @@ public class XWCardLayout extends XLayoutContainer {
public static final String DEFAULT_NAME = "cardlayout"; public static final String DEFAULT_NAME = "cardlayout";
//默认蓝色标题背景
private static final Color TITLE_COLOR = new Color(51, 132, 240);
public XWCardLayout(WCardLayout widget, Dimension initSize) { public XWCardLayout(WCardLayout widget, Dimension initSize) {
super(widget, initSize); super(widget, initSize);
} }
@ -399,24 +395,10 @@ public class XWCardLayout extends XLayoutContainer {
@Override @Override
public void refreshStylePreviewEffect() { public void refreshStylePreviewEffect() {
BorderPacker style = toData().getBorderStyle(); BorderPacker style = toData().getBorderStyle();
initBorderTitleStyle(style);
refreshBorderAndBackgroundStylePreviewEffect(); refreshBorderAndBackgroundStylePreviewEffect();
clearOrShowTitleLayout(ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE)); clearOrShowTitleLayout(ComparatorUtils.equals(style.getType(), LayoutBorderStyle.TITLE));
} }
private void initBorderTitleStyle(BorderPacker style) {
//初始化默认标题样式
if (!initFlag) {
return;
}
style.setType(LayoutBorderStyle.TITLE);
style.setBorder(Constants.LINE_THIN);
TitlePacker widgetTitle = style.getTitle();
widgetTitle.setBackground(ColorBackground.getInstance(TITLE_COLOR));
initFlag = false;
}
//隐藏或显示标题部分 //隐藏或显示标题部分
protected void clearOrShowTitleLayout(boolean isTitleStyle) { protected void clearOrShowTitleLayout(boolean isTitleStyle) {
XWCardMainBorderLayout mainLayout = (XWCardMainBorderLayout) this.getBackupParent(); XWCardMainBorderLayout mainLayout = (XWCardMainBorderLayout) this.getBackupParent();

18
designer-form/src/main/java/com/fr/design/gui/xpane/CardTagLayoutStylePane.java

@ -3,6 +3,8 @@
*/ */
package com.fr.design.gui.xpane; package com.fr.design.gui.xpane;
import com.fr.form.ui.LayoutBorderStyle;
import javax.swing.JPanel; import javax.swing.JPanel;
/** /**
@ -10,6 +12,8 @@ import javax.swing.JPanel;
*/ */
public class CardTagLayoutStylePane extends LayoutStylePane { public class CardTagLayoutStylePane extends LayoutStylePane {
private LayoutBorderStyle backupStyleFromPopulating = new LayoutBorderStyle();
@Override @Override
protected JPanel createTitleStylePane(){ protected JPanel createTitleStylePane(){
JPanel panel = super.createTitleStylePane(); JPanel panel = super.createTitleStylePane();
@ -21,4 +25,18 @@ public class CardTagLayoutStylePane extends LayoutStylePane {
protected JPanel createBackgroundStylePane(boolean supportCornerRadius) { protected JPanel createBackgroundStylePane(boolean supportCornerRadius) {
return super.createBackgroundStylePane(false); return super.createBackgroundStylePane(false);
} }
@Override
public void populateBean(LayoutBorderStyle style) {
this.backupStyleFromPopulating = style;
super.populateBean(style);
}
@Override
public LayoutBorderStyle updateBean() {
LayoutBorderStyle style = super.updateBean();
style.setTitle(backupStyleFromPopulating.getTitle());
style.setType(backupStyleFromPopulating.getType());
return style;
}
} }

Loading…
Cancel
Save