diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java b/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java index 2e5f56981d..baf7920e14 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java @@ -70,13 +70,10 @@ public class ColorPicker extends JDialog implements ActionListener { // 主要针对"图案"选项卡中的"前景"、"背景" if (this.setColorRealTime) { colorSelectable.setColor(Color.WHITE); // setColor 可以关闭弹窗 - try { - Thread.sleep(100); // 等待弹窗关闭 - } catch (InterruptedException e) { - FineLoggerFactory.getLogger().error(e.getMessage(), e); - Thread.currentThread().interrupt(); - } - colorPickerPanel.captureScreen(); + // REPORT-82110 确保关闭所有弹窗后截屏 + SwingUtilities.invokeLater(() -> { + colorPickerPanel.captureScreen(); + }); } } diff --git a/designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java b/designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java index 9a8640f627..11fe154469 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java +++ b/designer-base/src/main/java/com/fr/design/style/color/UIToolbarColorButton.java @@ -153,12 +153,22 @@ public class UIToolbarColorButton extends UICombinationButton implements PopupHi popupWin = null; } + // 取色器取色时,隐藏弹出框,无需经过macOS的判断 + public void hidePopupMenu4PickColor() { + if (popupWin != null) { + popupWin.setVisible(false); + } + + popupWin = null; + } + private ColorControlWindow getColorControlWindow() { //find parant. if (this.popupWin == null) { this.popupWin = new ColorControlWindow(this.isCanBeNull(), UIToolbarColorButton.this) { @Override protected void colorChanged() { + hidePopupMenu4PickColor(); UIToolbarColorButton.this.setColor(this.getColor()); }