From 15341520dd5dc7688629ec3dbf603b9404d55fca Mon Sep 17 00:00:00 2001 From: shine Date: Thu, 18 Nov 2021 17:33:05 +0800 Subject: [PATCH] =?UTF-8?q?CHART-21785=20cpt=E7=BC=96=E8=BE=91=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E8=83=8C=E6=99=AF=E5=92=8C=E5=BD=93=E5=89=8D=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E9=A2=9C=E8=89=B2=E8=83=8C=E6=99=AF=E4=B8=80=E6=A0=B7?= =?UTF-8?q?=20design?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utils/gui/AdjustWorkBookDefaultStyleUtils.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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 abae997e3..760fc3c80 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,6 +18,16 @@ 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 Color currentStoryBack = null; + + public static void setCurrentStoryBack(Color color) { + currentStoryBack = color; + } + + private static Color getCurrentStoryBack() { + return currentStoryBack == null ? TEMPLATE_BACKGROUND : currentStoryBack; + } + public static void adjustCellElement(CellElement cellElement) { if (DesignModeContext.isDuchampMode()) { Style style = cellElement.getStyle(); @@ -33,14 +43,14 @@ public class AdjustWorkBookDefaultStyleUtils { public static void adjustFloatElement(FloatElement floatElement) { if (DesignModeContext.isDuchampMode()) { Style style = floatElement.getStyle(); - style = style.deriveBackground(ColorBackground.getInstance(TEMPLATE_BACKGROUND)); + style = style.deriveBackground(ColorBackground.getInstance(getCurrentStoryBack())); style = style.deriveFRFont(style.getFRFont().applyForeground(Color.WHITE)); floatElement.setStyle(style); } } public static Color adjustBack(Color color) { - return DesignModeContext.isDuchampMode() ? TEMPLATE_BACKGROUND : color; + return DesignModeContext.isDuchampMode() ? getCurrentStoryBack() : color; } }