From 17f87679c7a054b3206c7190dabe7512e4e9ebfd Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 23 Aug 2021 19:24:08 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-51919=20-=20=E4=B8=BB=E9=A2=98=E5=88=87?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/theme/edit/ui/ColorListPane.java | 9 +++++---- .../com/fr/design/style/color/NewColorSelectBox.java | 1 + .../com/fr/design/style/color/NewColorSelectPane.java | 9 ++------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ui/ColorListPane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ui/ColorListPane.java index 03e24cb130..ff9f8c6e73 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ui/ColorListPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/edit/ui/ColorListPane.java @@ -4,7 +4,7 @@ import com.fr.base.background.ColorBackground; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.style.AbstractSelectBox; -import com.fr.design.style.color.ColorSelectPane; +import com.fr.design.style.color.NewColorSelectPane; import javax.swing.JPanel; import javax.swing.event.ChangeEvent; @@ -130,7 +130,7 @@ public class ColorListPane extends JPanel implements UIObserver { private static class ColorButton extends AbstractSelectBox { private Color color; - private ColorSelectPane colorPane; + private NewColorSelectPane colorPane; private ChangeListener changeListener; public ColorButton(Color color) { @@ -145,7 +145,7 @@ public class ColorListPane extends JPanel implements UIObserver { @Override public JPanel initWindowPane(double preferredWidth) { - colorPane = new ColorSelectPane(false) { + colorPane = new NewColorSelectPane(false) { @Override public void setVisible(boolean b) { super.setVisible(b); @@ -156,10 +156,11 @@ public class ColorListPane extends JPanel implements UIObserver { return false; } }; + colorPane.setColor(this.getSelectObject()); colorPane.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { hidePopupMenu(); - color = ((ColorSelectPane) e.getSource()).getColor(); + color = ((NewColorSelectPane) e.getSource()).getColor(); fireDisplayComponent(ColorBackground.getInstance(color)); ColorListPane.ColorButton.this.fireStateChanged(); } diff --git a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java index 3ac7eff79a..04d368e6bc 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java +++ b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectBox.java @@ -59,6 +59,7 @@ public class NewColorSelectBox extends AbstractSelectBox implements UIObs public JPanel initWindowPane(double preferredWidth) { // 下拉的时候重新生成面板,以刷新最近使用颜色 colorPane = new NewColorSelectPane(false); + colorPane.setColor(this.getSelectObject()); colorPane.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { hidePopupMenu(); diff --git a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java index 435753964d..8abab768ab 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java +++ b/designer-base/src/main/java/com/fr/design/style/color/NewColorSelectPane.java @@ -104,8 +104,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { row1Pane.add(new UILabel(Toolkit.i18nText("Fine-Design_Basic_Used")), BorderLayout.CENTER); centerPane.add(row1Pane); // 最近使用 - usedColorPane = new NewUsedColorPane(8, this, selectRealTime()); - usedColorPane.setPreferredSize(new Dimension(168, 16)); + usedColorPane = new NewUsedColorPane(9, this, selectRealTime()); row1Pane.add(usedColorPane.getPane(), BorderLayout.SOUTH); // mod by anchore 16/11/16 @@ -417,7 +416,7 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { private void initialComponents() { int total = columns; JPanel panel = new JPanel(); - panel.setLayout(new GridLayout(1, columns + 2, 3, 3)); + panel.setLayout(new GridLayout(1, columns + 1, 3, 3)); panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); //最近使用颜色 Color[] colors = DesignerEnvManager.getEnvManager().getColorConfigManager().getColors(); @@ -430,10 +429,6 @@ public class NewColorSelectPane extends BasicPane implements ColorSelectable { // 取色按钮 JButton pickColorButton = PickColorButtonFactory.getPickColorButton(selectable, PickColorButtonFactory.IconType.ICON16, setColorRealTime); panel.add(pickColorButton); - - ColorCell cc = new ColorCell(UsedColorPane.DEFAULT_COLOR, selectable); - cc.setVisible(false); - panel.add(cc); this.pane = panel; }