From cd8ff843ec4d9f7f38f69bf968cfc45660fe74a6 Mon Sep 17 00:00:00 2001 From: hades Date: Tue, 10 May 2022 09:26:45 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-69846=20=E5=A4=B9=E5=9C=A8=E4=B8=AD?= =?UTF-8?q?=E9=97=B4=E7=9A=84=E5=8D=95=E5=85=83=E6=A0=BC=EF=BC=8C=E4=B8=8E?= =?UTF-8?q?=E5=85=B6=E4=BB=96=E5=8D=95=E5=85=83=E6=A0=BC=E6=A1=86=E9=80=89?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E8=BE=B9=E6=A1=86=E6=97=B6=EF=BC=8C=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=A0=BC=E8=83=8C=E6=99=AF=E9=A2=9C=E8=89=B2=E4=BC=9A?= =?UTF-8?q?=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/gui/style/BackgroundPane.java | 10 ++++++++++ .../main/java/com/fr/design/gui/style/BorderPane.java | 5 ++++- .../backgroundpane/NullBackgroundQuickPane.java | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java b/designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java index bdf96f32e..3e0f6c213 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/BackgroundPane.java @@ -34,6 +34,11 @@ public class BackgroundPane extends AbstractBasicStylePane { //获取当前面板 protected BackgroundQuickPane currentPane = null; + /** + * 记录上次选中的面板 + */ + protected BackgroundQuickPane lastSelectedPane = null; + public BackgroundPane() { this.initComponents(); @@ -62,6 +67,9 @@ public class BackgroundPane extends AbstractBasicStylePane { @Override public void itemStateChanged(ItemEvent e) { cardlayout.show(centerPane, (String) typeComboBox.getSelectedItem()); + if (e.getStateChange() == ItemEvent.DESELECTED) { + lastSelectedPane = currentPane; + } currentPane = paneList[typeComboBox.getSelectedIndex()]; fireStateChanged(); } @@ -144,6 +152,8 @@ public class BackgroundPane extends AbstractBasicStylePane { pane.populateBean(background); typeComboBox.setSelectedIndex(i); currentPane = paneList[i]; + // 填充 初始化 + lastSelectedPane = currentPane; return; } } diff --git a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java index 3c917ea45..6d6259393 100644 --- a/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java +++ b/designer-base/src/main/java/com/fr/design/gui/style/BorderPane.java @@ -15,6 +15,7 @@ import com.fr.design.gui.icombobox.LineComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.backgroundpane.NullBackgroundQuickPane; import com.fr.design.style.color.NewColorSelectBox; import com.fr.design.utils.gui.AdjustWorkBookDefaultStyleUtils; import com.fr.general.IOUtils; @@ -246,7 +247,9 @@ public class BorderPane extends AbstractBasicStylePane implements GlobalNameObse style = AdjustWorkBookDefaultStyleUtils.adjustCellElement(Style.DEFAULT_STYLE); } - if (backgroundPane.currentPane.isBackgroundChange()) { + boolean isSetNullBackground = backgroundPane.currentPane instanceof NullBackgroundQuickPane + && !(backgroundPane.lastSelectedPane instanceof NullBackgroundQuickPane); + if (backgroundPane.currentPane.isBackgroundChange() || isSetNullBackground) { style = style.deriveBackground(backgroundPane.update()); } if (BORDER_SET.contains(globalNameListener.getGlobalName())) { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/NullBackgroundQuickPane.java b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/NullBackgroundQuickPane.java index 9a86a38c1..44a46d60a 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/NullBackgroundQuickPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/backgroundpane/NullBackgroundQuickPane.java @@ -35,7 +35,7 @@ public class NullBackgroundQuickPane extends BackgroundQuickPane { @Override public boolean isBackgroundChange() { - return true; + return false; } /**