diff --git a/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java b/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java index c3c087b4db..4bc1794561 100644 --- a/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java +++ b/designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java @@ -18,13 +18,23 @@ public class AdjustWorkBookDefaultStyleUtils { private static final Color TEMPLATE_BACKGROUND = new Color(16, 11, 43); private static final Color CELL_ELEMENT_BORDER = new Color(110, 110, 110); private static final Color CELL_ELEMENT_FONT_FOREGROUND = Color.WHITE; + private static final Color CELL_ELEMENT_FONT_FOREGROUND_4_LIGHT_THEME = Color.BLACK; private static Color currentStoryBack = null; + private static boolean isDarkTheme = true; public static void setCurrentStoryBack(Color color) { currentStoryBack = color; } + public static void setIsDarkTheme(boolean isDarkTheme) { + AdjustWorkBookDefaultStyleUtils.isDarkTheme = isDarkTheme; + } + + private static Color getCellForegroundColor() { + return isDarkTheme ? CELL_ELEMENT_FONT_FOREGROUND : CELL_ELEMENT_FONT_FOREGROUND_4_LIGHT_THEME; + } + private static Color getCurrentStoryBack() { return currentStoryBack == null ? TEMPLATE_BACKGROUND : currentStoryBack; } @@ -39,7 +49,7 @@ public class AdjustWorkBookDefaultStyleUtils { public static Style adjustCellElement(Style style) { if (DesignModeContext.isDuchampMode()) { - style = style.deriveFRFont(style.getFRFont().applyForeground(CELL_ELEMENT_FONT_FOREGROUND)); + style = style.deriveFRFont(style.getFRFont().applyForeground(getCellForegroundColor())); style = style.deriveBorder(0, CELL_ELEMENT_BORDER, 0, CELL_ELEMENT_BORDER, 0, CELL_ELEMENT_BORDER, @@ -49,7 +59,7 @@ public class AdjustWorkBookDefaultStyleUtils { } public static Color adjustCellElementFontForeground(Color color) { - return DesignModeContext.isDuchampMode() ? CELL_ELEMENT_FONT_FOREGROUND : color; + return DesignModeContext.isDuchampMode() ? getCellForegroundColor() : color; } public static void adjustFloatElement(FloatElement floatElement) { diff --git a/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java b/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java index 69cedccd49..4af7b9b6d1 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/DesktopWidgetStyleEditPane.java @@ -9,6 +9,7 @@ import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.design.style.color.NewColorSelectBox; import com.fr.design.utils.DesignUtils; +import com.fr.design.widget.FRWidgetFactory; import com.fr.locale.InterProviderFactory; import com.fr.stable.StringUtils; import com.fr.util.ColorUtils; @@ -55,7 +56,8 @@ public class DesktopWidgetStyleEditPane extends WidgetS initSelectBackgroundColorBox(); initFontNameSelectBox(); return new Component[][]{ - new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Color")), colorSelectBox}, new Component[]{WidgetThemeDesignerUtils.createTopAlignmentLabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Widget_Background")), initBackGroundComponent()}, + new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Color")), colorSelectBox}, + new Component[]{WidgetThemeDesignerUtils.createTopAlignmentLabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Widget_Background")), initBackGroundComponent()}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Line")), lineComboBox}, new Component[]{null, lineComboColorSelectBox}, new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Widget_Theme_Border_Radius")), borderRadiusSpinner}, @@ -67,7 +69,10 @@ public class DesktopWidgetStyleEditPane extends WidgetS } private Column initBackGroundComponent() { - return column(10, cell(widgetBgColorSelectBox), cell(widgetBgAlphaDragPane)).getComponent(); + return column(10, + cell(widgetBgColorSelectBox), + cell(FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Form_Widget-Style_Alpha"))), + cell(widgetBgAlphaDragPane)).getComponent(); } private void initSelectBackgroundColorBox() { diff --git a/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditPane.java b/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditPane.java index 39389469a6..bf6ad6c4fd 100644 --- a/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditPane.java +++ b/designer-base/src/main/java/com/fr/widgettheme/theme/edit/widget/WidgetStyleEditPane.java @@ -18,6 +18,7 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.style.color.NewColorSelectBox; +import com.fr.design.widget.FRWidgetFactory; import com.fr.general.IOUtils; import com.fr.stable.StringUtils; import com.fr.widgettheme.theme.widget.theme.WidgetThemeDisplayConstants; @@ -120,6 +121,7 @@ public class WidgetStyleEditPane extends BasicBeanPane< private Column initBackGroundComponent() { return column(10, cell(widgetBgColorSelectBox), + cell(FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Form_Widget-Style_Alpha"))), cell(widgetBgAlphaDragPane) ).getComponent(); } diff --git a/designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java b/designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java index a06a872bf1..14183ed2e6 100644 --- a/designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java +++ b/designer-form/src/main/java/com/fr/design/widgettheme/BaseStyleSettingPane.java @@ -23,6 +23,7 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.JTemplate; import com.fr.design.style.color.NewColorSelectBox; import com.fr.design.utils.DesignUtils; +import com.fr.design.widget.FRWidgetFactory; import com.fr.form.ui.Widget; import com.fr.general.FRFont; import com.fr.general.IOUtils; @@ -164,6 +165,7 @@ public abstract class BaseStyleSettingPane extends BasicBeanPa return column( 10, cell(widgetBgColorSelectBox), + cell(FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Form_Widget-Style_Alpha"))), cell(widgetBgAlphaDragPane) ).getComponent(); } diff --git a/designer-form/src/main/java/com/fr/design/widgettheme/processor/WidgetThemeCreatorPaneAdder.java b/designer-form/src/main/java/com/fr/design/widgettheme/processor/WidgetThemeCreatorPaneAdder.java index 1e36b42e0e..b2e3b70a86 100644 --- a/designer-form/src/main/java/com/fr/design/widgettheme/processor/WidgetThemeCreatorPaneAdder.java +++ b/designer-form/src/main/java/com/fr/design/widgettheme/processor/WidgetThemeCreatorPaneAdder.java @@ -1,8 +1,11 @@ package com.fr.design.widgettheme.processor; -import com.fr.design.widgettheme.common.SelectEditorSettingPane; -import com.fr.widgettheme.util.WidgetThemeDesignerUtils; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.widgettheme.common.ButtonSettingPane; +import com.fr.design.widgettheme.common.EditorSettingPane; +import com.fr.design.widgettheme.common.NormalButtonSettingPane; +import com.fr.design.widgettheme.common.SelectEditorSettingPane; +import com.fr.design.widgettheme.common.TreeEditorSettingPane; import com.fr.form.parameter.FormSubmitButton; import com.fr.form.ui.Button; import com.fr.form.ui.CheckBox; @@ -21,10 +24,7 @@ import com.fr.form.ui.TreeEditor; import com.fr.report.web.button.form.TreeNodeToggleButton; import com.fr.report.web.button.write.AppendRowButton; import com.fr.report.web.button.write.DeleteRowButton; -import com.fr.design.widgettheme.common.ButtonSettingPane; -import com.fr.design.widgettheme.common.EditorSettingPane; -import com.fr.design.widgettheme.common.NormalButtonSettingPane; -import com.fr.design.widgettheme.common.TreeEditorSettingPane; +import com.fr.widgettheme.util.WidgetThemeDesignerUtils; import com.fr.widgettheme.utils.WidgetThemeServerUtils; import java.util.Arrays; @@ -97,7 +97,7 @@ public class WidgetThemeCreatorPaneAdder { } private static void acceptEditor(Class creator, List> extraPaneList) { - boolean accept = WidgetThemeServerUtils.isNewComboBoxTreeEditor(creator) || EDITOR_SET.contains(creator); + boolean accept = EDITOR_SET.contains(creator); if (accept) { insertShortCut(extraPaneList, new EditorSettingPane<>()); } @@ -126,7 +126,7 @@ public class WidgetThemeCreatorPaneAdder { } private static void acceptSelect(Class creator, List> extraPaneList) { - boolean accept = SELECT_SET.contains(creator); + boolean accept = WidgetThemeServerUtils.isNewComboBoxTreeEditor(creator) || SELECT_SET.contains(creator); if (accept) { insertShortCut(extraPaneList, new SelectEditorSettingPane<>()); } diff --git a/designer-realize/src/main/java/com/fr/design/present/PresentPane.java b/designer-realize/src/main/java/com/fr/design/present/PresentPane.java index 8e8a669c9f..95d45fa45d 100644 --- a/designer-realize/src/main/java/com/fr/design/present/PresentPane.java +++ b/designer-realize/src/main/java/com/fr/design/present/PresentPane.java @@ -52,10 +52,9 @@ public class PresentPane extends UIComboBoxPane { @Override public void populateBean(Present ob) { if(ob == null) { - dictPresentPane.reset(); - formulaPresentPane.reset(); - barCodePane.reset(); - currencyLinePane.reset(); + for (FurtherBasicBeanPane pane : cards) { + pane.reset(); + } } super.populateBean(ob); }