|
|
@ -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(); |
|
|
|