Browse Source

Pull request #14690: REPORT-126773 fix: 修复自定义主题修改配色预览不生效问题

Merge in DESIGN/design from ~ANNER/design:feature/x to feature/x

* commit '213181dc99a11f01a6a661e619fdb8ae624ff429':
  REPORT-126773 fix: 修复自定义主题修改配色预览不生效问题
feature/x
Anner-王敬松 3 months ago
parent
commit
553f295ea4
  1. 27
      designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

27
designer-base/src/main/java/com/fr/design/mainframe/JTemplate.java

@ -268,9 +268,14 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
TemplateTheme usingTheme = getTemplateTheme();
boolean isUsingThemeChanged = StringUtils.equals(event.themName, usingTheme.getName());
if (isUsingThemeChanged && (event.action == TemplateThemeConfig.ThemeConfigAction.REMOVE ||
event.action == TemplateThemeConfig.ThemeConfigAction.UPDATE)) {
if (event.action == TemplateThemeConfig.ThemeConfigAction.REMOVE ||
event.action == TemplateThemeConfig.ThemeConfigAction.UPDATE) {
if (isUsingThemeChanged) {
checkAndResetTheme();
} else {
// 修改主题配置,但是没有修改主题名称 , 需要重新保存文件
fireSuperTargetModified();
}
}
}
};
@ -470,6 +475,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
/**
* 用于 切换工作目录 时的模板资源暂存
*
* @return
*/
public FILE templateToStashFile4Envchange() {
@ -545,6 +551,7 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
/**
* 刷新 模板资源 EditingFILE
* 仅在切换工作目录reload模板时使用
*
* @param file
*/
public void refreshResourceAndEditingFILE(FILE file) {
@ -1785,7 +1792,6 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
}
private CallbackSaveWorker saveAs(boolean showLoc) {
FILE editingFILE = this.getEditingFILE();
if (editingFILE == null) {
@ -1975,7 +1981,6 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
}
@Override
public void saveDirectly() {
if (isSaving()) {
@ -2125,17 +2130,19 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
/**
* 获取此模板所使用的tab栏操作类型
*
* @return
*/
public String getTemplateTabOperatorType(){
public String getTemplateTabOperatorType() {
return DEFAULT_TAB_OPERATOR;
}
/**
* 当前模板是否可以被保存
*
* @return /
*/
public boolean canBeSaved(){
public boolean canBeSaved() {
return true;
}
@ -2144,15 +2151,16 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
*
* @return /
*/
public boolean supportCache(){
public boolean supportCache() {
return true;
}
/**
* 获取此模板在tab栏中显示的名称
*
* @return
*/
public String getTabShowName(JTemplate<?, ?> jTemplate){
public String getTabShowName(JTemplate<?, ?> jTemplate) {
String name = TemplateUtils.createLockeTemplatedName(jTemplate, jTemplate.getTemplateName());
if (!jTemplate.isSaved() && !name.endsWith(" *")) {
name += " *";
@ -2162,9 +2170,10 @@ public abstract class JTemplate<T extends BaseBook, U extends BaseUndoState<?>>
/**
* 切换环境之前是否需要保存
*
* @return
*/
public boolean needSaveBeforeSwitchEnv(){
public boolean needSaveBeforeSwitchEnv() {
return false;
}

Loading…
Cancel
Save