Browse Source

Pull request #14633: REPORT-113978 修复newui自动缩放导致的界面过大&UI保存时卡死问题

Merge in DESIGN/design from ~VITO/c-design:fbp-1.0 to fbp-1.0

* commit '0929b94ded651f0a1af5706a08f0d6feac1d464f':
  REPORT-113978 修复保存时UI卡死问题
  REPORT-113978 修复newui自动缩放导致的界面过大
fbp-1.0
vito-刘恒霖 4 months ago
parent
commit
f8938fb821
  1. 15
      designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/DatacentersJSBridge.java
  2. 4
      designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/JxTableDataNamePane.java

15
designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/DatacentersJSBridge.java

@ -10,6 +10,7 @@ import com.fr.design.dialog.UIDialog;
import com.fr.design.formula.FormulaFactory; import com.fr.design.formula.FormulaFactory;
import com.fr.design.formula.UIFormula; import com.fr.design.formula.UIFormula;
import com.fr.design.jxbrowser.JxUIPane; import com.fr.design.jxbrowser.JxUIPane;
import com.fr.design.ui.util.UIUtil;
import com.fr.json.revise.EmbedJson; import com.fr.json.revise.EmbedJson;
import com.fr.locale.InterProviderFactory; import com.fr.locale.InterProviderFactory;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
@ -178,11 +179,11 @@ public class DatacentersJSBridge {
public void okAction() { public void okAction() {
CompletableFuture CompletableFuture
.runAsync(() -> relationPanel.updateNamePane()) .runAsync(() -> relationPanel.updateNamePane())
.thenRunAsync(() -> { .thenRun(() -> {
Window ancestor = SwingUtilities.getWindowAncestor(relationPanel); Window ancestor = SwingUtilities.getWindowAncestor(relationPanel);
if (ancestor instanceof UIDialog) { if (ancestor instanceof UIDialog) {
try { try {
((UIDialog) ancestor).doOK(); SwingUtilities.invokeLater(() -> ((UIDialog) ancestor).doOK());
} catch (Exception e) { } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
@ -195,9 +196,11 @@ public class DatacentersJSBridge {
*/ */
@JSBridge @JSBridge
public void cancelAction() { public void cancelAction() {
Window ancestor = SwingUtilities.getWindowAncestor(relationPanel); UIUtil.invokeLaterIfNeeded(() -> {
if (ancestor instanceof UIDialog) { Window ancestor = SwingUtilities.getWindowAncestor(relationPanel);
((UIDialog) ancestor).doCancel(); if (ancestor instanceof UIDialog) {
} ((UIDialog) ancestor).doCancel();
}
});
} }
} }

4
designer-base/src/main/java/com/fr/design/data/tabledata/datacenter/JxTableDataNamePane.java

@ -1,5 +1,6 @@
package com.fr.design.data.tabledata.datacenter; package com.fr.design.data.tabledata.datacenter;
import com.fine.theme.utils.FineUIScale;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.dialog.BasicPane.NamePane; import com.fr.design.dialog.BasicPane.NamePane;
@ -61,7 +62,8 @@ public class JxTableDataNamePane extends NamePane {
*/ */
public static Dimension calculatePaneDimension() { public static Dimension calculatePaneDimension() {
DesignerFrame parent = DesignerContext.getDesignerFrame(); DesignerFrame parent = DesignerContext.getDesignerFrame();
return new Dimension((int) (parent.getWidth() * 0.8), (int) (parent.getHeight() * 0.9)); return new Dimension((int) (FineUIScale.unscale(parent.getWidth()) * 0.8),
(int) (FineUIScale.unscale(parent.getHeight()) * 0.9));
} }
} }

Loading…
Cancel
Save