Browse Source

REPORT-58034 【主题切换】模板主题页面,不应该显示☆

【问题原因】
使用构造函数参数控制列表中的主题块是否展示当前
适用于新建模版的主题的标记

【改动思路】
同上
research/11.0
Starryi 3 years ago
parent
commit
798a5af865
  1. 5
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java
  2. 6
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeListPane.java
  3. 2
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeManagePane.java
  4. 2
      designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeUsingDialog.java

5
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeBlock.java

@ -49,6 +49,7 @@ public class TemplateThemeBlock<T extends TemplateTheme> extends JPanel {
private final Icon theme4currentTemplateMarkIcon = IOUtils.readIcon("/com/fr/design/form/images/theme4currentTemplate.png");
private final Icon theme4NewTemplateMarkIcon= IOUtils.readIcon("/com/fr/design/form/images/theme4newTemplate.png");
private final Icon profileIcon = IOUtils.readIcon("/com/fr/design/icon/icon_edit.png");
private final boolean displayTheme4NewTemplateMarker;
private UILabel thumbnailLabel;
// UIButton会影响Block的手势监听,这里使用UILabel代替,点击事件也有Block代为处理
@ -59,9 +60,11 @@ public class TemplateThemeBlock<T extends TemplateTheme> extends JPanel {
private MouseAdapter clickListener;
public TemplateThemeBlock(String name,
boolean displayTheme4NewTemplateMarker,
TemplateThemeConfig<T> config,
TemplateThemeProfilePane<T> profilePane) {
this.name = name;
this.displayTheme4NewTemplateMarker = displayTheme4NewTemplateMarker;
this.config = config;
this.profilePane = profilePane;
@ -192,7 +195,7 @@ public class TemplateThemeBlock<T extends TemplateTheme> extends JPanel {
}
}
if (StringUtils.equals(config.getThemeName4NewTemplate(), name)) {
if (displayTheme4NewTemplateMarker && StringUtils.equals(config.getThemeName4NewTemplate(), name)) {
theme4NewTemplateMarkIcon.paintIcon(this, g, 0, 0);
}

6
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeListPane.java

@ -34,6 +34,7 @@ public class TemplateThemeListPane<T extends TemplateTheme> extends BasicPane {
private final AsyncThemeFetcher<T> asyncThemeFetcher;
private final boolean displayTheme4NewTemplateMarker;
protected final TemplateThemeConfig<T> config;
private final TemplateThemeProfilePane<T> profilePane;
private final JPanel contentListPane;
@ -47,7 +48,8 @@ public class TemplateThemeListPane<T extends TemplateTheme> extends BasicPane {
private ChangeListener changeListener;
public TemplateThemeListPane(TemplateThemeConfig<T> config, TemplateThemeProfilePane<T> profilePane) {
public TemplateThemeListPane(boolean displayTheme4NewTemplateMarker, TemplateThemeConfig<T> config, TemplateThemeProfilePane<T> profilePane) {
this.displayTheme4NewTemplateMarker = displayTheme4NewTemplateMarker;
this.config = config;
this.profilePane = profilePane;
this.contentListPane = new JPanel();
@ -95,7 +97,7 @@ public class TemplateThemeListPane<T extends TemplateTheme> extends BasicPane {
}
private TemplateThemeBlock<T> createNewTemplateThemeBlock(String name) {
final TemplateThemeBlock<T> block = new TemplateThemeBlock<>(name, config, profilePane);
final TemplateThemeBlock<T> block = new TemplateThemeBlock<>(name, displayTheme4NewTemplateMarker, config, profilePane);
block.addClickListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {

2
designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeManagePane.java

@ -75,7 +75,7 @@ public class TemplateThemeManagePane<T extends TemplateTheme> extends BasicPane
public TemplateThemeManagePane(TemplateThemeConfig<T> config, TemplateThemeProfilePane<T> profilePane) {
this.config = config;
this.profilePane = profilePane;
this.themeListPane = new TemplateThemeListPane<>(config, profilePane);
this.themeListPane = new TemplateThemeListPane<>(true, config, profilePane);
this.removeAction = new RemoveThemeAction(false);
this.setTheme4NewTemplateButton = new UIButton(Toolkit.i18nText("Fine-Design_Template_Theme_Manager_Pane_Default_Setting"));
this.asyncThemeFetcher = new AsyncThemeFetcher<>(1, config);

2
designer-base/src/main/java/com/fr/design/mainframe/theme/dialog/TemplateThemeUsingDialog.java

@ -37,7 +37,7 @@ public class TemplateThemeUsingDialog<T extends TemplateTheme> extends TemplateT
super(parent, Toolkit.i18nText("Fine-Design_Template_Theme_Using_Dialog_Title"), CONTENT_WIDTH, CONTENT_HEIGHT);
this.currentTemplate = template;
this.themeListPane = new TemplateThemeListPane<>(config, null);
this.themeListPane = new TemplateThemeListPane<>(false, config, null);
JPanel content = createContent();
UIButton openThemeManagerButton = createOpenThemeManagerButton();

Loading…
Cancel
Save