Browse Source

REPORT-111995 弹出面板适配DPI缩放

newui
Levy.Xie-解安森 10 months ago
parent
commit
824b8953a4
  1. 20
      designer-base/src/main/java/com/fr/design/dialog/BasicDialog.java
  2. 5
      designer-base/src/main/java/com/fr/design/formula/FormulaPane.java

20
designer-base/src/main/java/com/fr/design/dialog/BasicDialog.java

@ -1,8 +1,11 @@
package com.fr.design.dialog;
import com.fine.theme.utils.FineUIScale;
import com.fr.common.annotations.Open;
import java.awt.*;
import java.awt.Dialog;
import java.awt.Dimension;
import java.awt.Frame;
@Open
public abstract class BasicDialog extends UIDialog {
@ -40,12 +43,23 @@ public abstract class BasicDialog extends UIDialog {
super(parent, pane, isNeedButtonPane);
}
/**
* 设置对话框大小方法内已进行dpi适配传参无需考虑dpi适配
*
* @param d 对话框尺寸
*/
protected void setBasicDialogSize(Dimension d) {
super.setSize(d.width, d.height);
super.setSize(FineUIScale.scale(d.width), FineUIScale.scale(d.height));
}
/**
* 设置对话框大小方法内已进行dpi适配传参无需考虑dpi适配
*
* @param w 宽度
* @param h 高度
*/
protected void setBasicDialogSize(int w, int h) {
super.setSize(w, h);
setBasicDialogSize(new Dimension(w, h));
}
@Override

5
designer-base/src/main/java/com/fr/design/formula/FormulaPane.java

@ -41,7 +41,6 @@ import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.RSyntaxTextArea;
import com.fr.design.gui.syntax.ui.rsyntaxtextarea.SyntaxConstants;
import com.fr.design.i18n.DesignSizeI18nManager;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.DesignerContext;
@ -749,8 +748,8 @@ public class FormulaPane extends BasicPane implements KeyListener, UIFormula {
}
public BasicDialog showLargeWindow(Window window, DialogActionListener l) {
int width = FineUIScale.scale(900);
int height = FineUIScale.scale(600);
int width = 900;
int height = 900;
BasicDialog basicDialog = super.showWindowWithCustomSize(window, l, new Dimension(width, height));
basicDialog.setMinimumSize(new Dimension(width, height));
basicDialog.setResizable(true);

Loading…
Cancel
Save