diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileStyleDefinePane.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileStyleDefinePane.java index 10fc42e8f1..860a0c9fb9 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileStyleDefinePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/DefaultMobileStyleDefinePane.java @@ -7,7 +7,10 @@ import com.fr.form.ui.container.cardlayout.WCardTagLayout; import com.fr.general.FRFont; import com.fr.general.cardtag.mobile.DefaultMobileTemplateStyle; import com.fr.general.cardtag.mobile.MobileTemplateStyle; +import com.fr.general.cardtag.mobile.TabFontConfig; + import java.awt.BasicStroke; +import java.awt.Color; import java.awt.Dimension; import java.awt.FontMetrics; import java.awt.Graphics; @@ -41,17 +44,17 @@ public class DefaultMobileStyleDefinePane extends MobileTemplateStyleDefinePane @Override public MobileTemplateStyle updateBean() { - return new DefaultMobileTemplateStyle(); + return getDefaultTemplateStyle(); } public MobileTemplateStyle updateConfig(){ - return new DefaultMobileTemplateStyle(); + return getDefaultTemplateStyle(); } @Override protected MobileTemplateStyle getDefaultTemplateStyle() { - return new DefaultMobileTemplateStyle(); + return new DefaultMobileTemplateStyle(new TabFontConfig(getTagLayout().getTitleFont())); } @Override @@ -74,6 +77,10 @@ public class DefaultMobileStyleDefinePane extends MobileTemplateStyleDefinePane this.setBackground(DefaultMobileTemplateStyle.DEFAULT_INITIAL_COLOR); } + public Color getInitialColor() { + return DefaultMobileTemplateStyle.DEFAULT_INITIAL_COLOR; + } + public void repaint() { super.repaint(); } @@ -94,11 +101,13 @@ public class DefaultMobileStyleDefinePane extends MobileTemplateStyleDefinePane int fontHeight = fm.getHeight(); int ascentHeight = fm.getAscent(); for (int i = 0; i < cardTagLayout.getWidgetCount(); i++) { + g2d.setColor(frFont.getForeground()); CardSwitchButton cardSwitchButton = cardTagLayout.getSwitchButton(i); String displayName = calculateDisplayName(cardSwitchButton.getText(), fm, eachWidth); int width = fm.stringWidth(displayName); g2d.drawString(displayName, (eachWidth - width) / 2, (panelHeight - fontHeight) / 2 + ascentHeight); if (i == 0) { + g2d.setColor(Color.BLACK); g2d.setStroke(new BasicStroke(2.0f)); g2d.drawLine(0, panelHeight - 1, eachWidth, panelHeight - 1); } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/TemplateStyleDefinePaneFactory.java b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/TemplateStyleDefinePaneFactory.java index 9b287de07f..dab5a03ba7 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/TemplateStyleDefinePaneFactory.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/mobile/ui/TemplateStyleDefinePaneFactory.java @@ -24,9 +24,10 @@ public class TemplateStyleDefinePaneFactory { public static BasicBeanPane createDefinePane(String style, WCardTagLayout tagLayout) { StyleDefinePaneUI styleDefinePaneUI = defineMap.get(style); - Class> clazz = styleDefinePaneUI.getaClass(); - if (clazz == null) { + if(styleDefinePaneUI == null){ + styleDefinePaneUI = defineMap.get(DefaultMobileTemplateStyle.STYLE_NAME); } + Class> clazz = styleDefinePaneUI.getaClass(); BasicBeanPane quickPane = null; try { quickPane = Reflect.on(clazz).create(tagLayout).get(); diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WCardTagLayoutDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WCardTagLayoutDefinePane.java index d1e68baf39..41ea1c1c7d 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WCardTagLayoutDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/WCardTagLayoutDefinePane.java @@ -115,6 +115,7 @@ public class WCardTagLayoutDefinePane extends AbstractDataModify templateStyleEditor.setValue(ob.getTemplateStyle()); FRFont frFont = layoutBorderStyle.getTitle().getFrFont(); if (frFont != null) { + ob.setTitleFont(frFont); frFontPane.populateBean(frFont); } } @@ -126,8 +127,10 @@ public class WCardTagLayoutDefinePane extends AbstractDataModify XWCardLayout xCardLayout = ((XWCardMainBorderLayout) topLayout).getCardPart(); LayoutBorderStyle layoutBorderStyle = xCardLayout.toData().getBorderStyle(); FRFont frFont = layoutBorderStyle.getTitle().getFrFont() == null ? FRFont.getInstance() : layoutBorderStyle.getTitle().getFrFont(); - layoutBorderStyle.getTitle().setFrFont(frFontPane.update(frFont)); + FRFont titleFont = frFontPane.update(frFont); + layoutBorderStyle.getTitle().setFrFont(titleFont); WCardTagLayout layout = (WCardTagLayout) creator.toData(); + layout.setTitleFont(titleFont); boolean isHori = displayPositionGroup.getSelectedIndex() == WTabDisplayPosition.TOP_POSITION.getType() || displayPositionGroup.getSelectedIndex() == WTabDisplayPosition.BOTTOM_POSITION.getType(); if (ComparatorUtils.equals(getGlobalName(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Tab_Style_Template"))) { layout.setDisplayPosition(WTabDisplayPosition.parse(displayPositionGroup.getSelectedIndex()));