Browse Source

Merge pull request #13856 in DESIGN/design from release/11.0 to bugfix/11.0

* commit '9d093f9a7855f05dd407936e6b253a134652980f':
  fix: 报表块适配fvs深浅色主题 #REPORT-116912
bugfix/11.0
superman 2 months ago
parent
commit
e80a885e77
  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,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) {

Loading…
Cancel
Save