Browse Source

Pull request #5920: REPORT-59770 【主题切换】编辑主题时,主题配色修改以后,细节配置和整体预览里的颜色没有相应联动

Merge in DESIGN/design from ~STARRYI/design:persist/11.0 to persist/11.0

* commit '3945a9f763ccbdd55adecc5bbf7ea8b7cc7867c4':
  REPORT-59770 【主题切换】编辑主题时,主题配色修改以后,细节配置和整体预览里的颜色没有相应联动
fix-lag
kerry 3 years ago
parent
commit
8d8b34f3c5
  1. 2
      designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java
  2. 7
      designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ui/ColorListPane.java

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

@ -111,7 +111,7 @@ public abstract class TemplateThemeProfilePane<T extends TemplateTheme> extends
addAttributeChangeListener(new AttributeChangeListener() {
@Override
public void attributeChange() {
if (!isPopulating) {
if (!isPopulating && !refreshingThemedColor) {
valueChangeAction();
}
}

7
designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ui/ColorListPane.java

@ -40,6 +40,8 @@ public class ColorListPane extends JPanel implements UIObserver {
private final EventListenerList colorChangeListenerList = new EventListenerList();
private UIObserverListener uiObserverListener;
private boolean isPopulating = false;
public ColorListPane() {
this(DEFAULT_COLOR_COUNT, DEFAULT_COLOR_SIZE, DEFAULT_COLOR_GAP);
}
@ -61,6 +63,9 @@ public class ColorListPane extends JPanel implements UIObserver {
colorButton.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (isPopulating) {
return;
}
colorList.set(index, colorButton.getSelectObject());
fireColorStateChanged();
}
@ -88,6 +93,7 @@ public class ColorListPane extends JPanel implements UIObserver {
}
public void populate(List<Color> colors) {
isPopulating = true;
colorList.clear();
for (int i = 0; i < colors.size(); i++) {
Color color = colors.get(i);
@ -96,6 +102,7 @@ public class ColorListPane extends JPanel implements UIObserver {
colorButtons.get(i).setSelectObject(color);
}
}
isPopulating = false;
}
public List<Color> update() {

Loading…
Cancel
Save