Browse Source

Pull request #6742: CHART-21785 cpt编辑状态背景和当前页面颜色背景一样 design

Merge in DESIGN/design from ~ZHENG/c-design:release/10.0 to release/10.0

* commit '042a5d0752f90a7dc197087a5040f744dad25064':
  CHART-21785 cpt编辑状态背景和当前页面颜色背景一样 design
zheng-1641779399395
zheng 3 years ago
parent
commit
5edddd28f7
  1. 14
      designer-base/src/main/java/com/fr/design/utils/gui/AdjustWorkBookDefaultStyleUtils.java

14
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 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_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) { public static void adjustCellElement(CellElement cellElement) {
if (DesignModeContext.isDuchampMode()) { if (DesignModeContext.isDuchampMode()) {
Style style = cellElement.getStyle(); Style style = cellElement.getStyle();
@ -33,14 +43,14 @@ public class AdjustWorkBookDefaultStyleUtils {
public static void adjustFloatElement(FloatElement floatElement) { public static void adjustFloatElement(FloatElement floatElement) {
if (DesignModeContext.isDuchampMode()) { if (DesignModeContext.isDuchampMode()) {
Style style = floatElement.getStyle(); 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)); style = style.deriveFRFont(style.getFRFont().applyForeground(Color.WHITE));
floatElement.setStyle(style); floatElement.setStyle(style);
} }
} }
public static Color adjustBack(Color color) { public static Color adjustBack(Color color) {
return DesignModeContext.isDuchampMode() ? TEMPLATE_BACKGROUND : color; return DesignModeContext.isDuchampMode() ? getCurrentStoryBack() : color;
} }
} }

Loading…
Cancel
Save