Optimize performance under macOS
This commit is contained in:
parent
1dc528803f
commit
bae9442614
|
@ -2,6 +2,7 @@ package com.luoboduner.moo.info.ui.dialog;
|
|||
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import com.formdev.flatlaf.extras.FlatSVGIcon;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
import com.intellij.uiDesigner.core.GridConstraints;
|
||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||
import com.intellij.uiDesigner.core.Spacer;
|
||||
|
@ -9,6 +10,7 @@ import com.luoboduner.moo.info.App;
|
|||
import com.luoboduner.moo.info.ui.UiConsts;
|
||||
import com.luoboduner.moo.info.util.ComponentUtil;
|
||||
import com.luoboduner.moo.info.util.ScrollUtil;
|
||||
import com.luoboduner.moo.info.util.SystemUtil;
|
||||
import com.luoboduner.moo.info.util.UpgradeUtil;
|
||||
|
||||
import javax.swing.*;
|
||||
|
@ -47,6 +49,15 @@ public class AboutDialog extends JDialog {
|
|||
setContentPane(contentPane);
|
||||
setModal(true);
|
||||
|
||||
if (SystemUtil.isMacOs() && SystemInfo.isMacFullWindowContentSupported) {
|
||||
this.getRootPane().putClientProperty("apple.awt.fullWindowContent", true);
|
||||
this.getRootPane().putClientProperty("apple.awt.transparentTitleBar", true);
|
||||
this.getRootPane().putClientProperty("apple.awt.fullscreenable", true);
|
||||
this.getRootPane().putClientProperty("apple.awt.windowTitleVisible", false);
|
||||
GridLayoutManager gridLayoutManager = (GridLayoutManager) contentPane.getLayout();
|
||||
gridLayoutManager.setMargin(new Insets(28, 0, 0, 0));
|
||||
}
|
||||
|
||||
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
|
||||
addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
|
|
|
@ -2,12 +2,14 @@ package com.luoboduner.moo.info.ui.dialog;
|
|||
|
||||
import cn.hutool.log.Log;
|
||||
import cn.hutool.log.LogFactory;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
import com.intellij.uiDesigner.core.GridConstraints;
|
||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||
import com.intellij.uiDesigner.core.Spacer;
|
||||
import com.luoboduner.moo.info.App;
|
||||
import com.luoboduner.moo.info.util.ComponentUtil;
|
||||
import com.luoboduner.moo.info.util.ScrollUtil;
|
||||
import com.luoboduner.moo.info.util.SystemUtil;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.TitledBorder;
|
||||
|
@ -35,6 +37,15 @@ public class SettingDialog extends JDialog {
|
|||
setContentPane(contentPane);
|
||||
setModal(true);
|
||||
|
||||
if (SystemUtil.isMacOs() && SystemInfo.isMacFullWindowContentSupported) {
|
||||
this.getRootPane().putClientProperty("apple.awt.fullWindowContent", true);
|
||||
this.getRootPane().putClientProperty("apple.awt.transparentTitleBar", true);
|
||||
this.getRootPane().putClientProperty("apple.awt.fullscreenable", true);
|
||||
this.getRootPane().putClientProperty("apple.awt.windowTitleVisible", false);
|
||||
GridLayoutManager gridLayoutManager = (GridLayoutManager) contentPane.getLayout();
|
||||
gridLayoutManager.setMargin(new Insets(28, 0, 0, 0));
|
||||
}
|
||||
|
||||
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
|
||||
addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
package com.luoboduner.moo.info.ui.dialog;
|
||||
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
import com.intellij.uiDesigner.core.GridConstraints;
|
||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||
import com.intellij.uiDesigner.core.Spacer;
|
||||
import com.luoboduner.moo.info.App;
|
||||
import com.luoboduner.moo.info.util.ComponentUtil;
|
||||
import com.luoboduner.moo.info.util.SystemUtil;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.TitledBorder;
|
||||
|
@ -26,6 +28,15 @@ public class SystemEnvResultDialog extends JDialog {
|
|||
setModal(true);
|
||||
getRootPane().setDefaultButton(buttonOK);
|
||||
|
||||
if (SystemUtil.isMacOs() && SystemInfo.isMacFullWindowContentSupported) {
|
||||
this.getRootPane().putClientProperty("apple.awt.fullWindowContent", true);
|
||||
this.getRootPane().putClientProperty("apple.awt.transparentTitleBar", true);
|
||||
this.getRootPane().putClientProperty("apple.awt.fullscreenable", true);
|
||||
this.getRootPane().putClientProperty("apple.awt.windowTitleVisible", false);
|
||||
GridLayoutManager gridLayoutManager = (GridLayoutManager) contentPane.getLayout();
|
||||
gridLayoutManager.setMargin(new Insets(28, 0, 0, 0));
|
||||
}
|
||||
|
||||
buttonOK.addActionListener(e -> onOK());
|
||||
|
||||
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.intellij.uiDesigner.core.Spacer;
|
|||
import com.luoboduner.moo.info.App;
|
||||
import com.luoboduner.moo.info.util.ComponentUtil;
|
||||
import com.luoboduner.moo.info.util.ConsoleUtil;
|
||||
import com.luoboduner.moo.info.util.SystemUtil;
|
||||
import oshi.SystemInfo;
|
||||
import oshi.hardware.*;
|
||||
import oshi.software.os.*;
|
||||
|
@ -38,6 +39,15 @@ public class SystemInfoTestDialog extends JDialog {
|
|||
setModal(true);
|
||||
getRootPane().setDefaultButton(buttonOK);
|
||||
|
||||
if (SystemUtil.isMacOs() && com.formdev.flatlaf.util.SystemInfo.isMacFullWindowContentSupported) {
|
||||
this.getRootPane().putClientProperty("apple.awt.fullWindowContent", true);
|
||||
this.getRootPane().putClientProperty("apple.awt.transparentTitleBar", true);
|
||||
this.getRootPane().putClientProperty("apple.awt.fullscreenable", true);
|
||||
this.getRootPane().putClientProperty("apple.awt.windowTitleVisible", false);
|
||||
GridLayoutManager gridLayoutManager = (GridLayoutManager) contentPane.getLayout();
|
||||
gridLayoutManager.setMargin(new Insets(28, 0, 0, 0));
|
||||
}
|
||||
|
||||
buttonOK.addActionListener(e -> onOK());
|
||||
|
||||
buttonCancel.addActionListener(e -> onCancel());
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="94766" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<margin top="0" left="0" bottom="10" right="10"/>
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
|
|
|
@ -4,11 +4,13 @@ import cn.hutool.core.io.FileUtil;
|
|||
import cn.hutool.core.io.StreamProgress;
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
import com.intellij.uiDesigner.core.GridConstraints;
|
||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||
import com.intellij.uiDesigner.core.Spacer;
|
||||
import com.luoboduner.moo.info.App;
|
||||
import com.luoboduner.moo.info.util.ComponentUtil;
|
||||
import com.luoboduner.moo.info.util.SystemUtil;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
@ -44,6 +46,15 @@ public class UpdateDialog extends JDialog {
|
|||
setModal(true);
|
||||
getRootPane().setDefaultButton(buttonOK);
|
||||
|
||||
if (SystemUtil.isMacOs() && SystemInfo.isMacFullWindowContentSupported) {
|
||||
this.getRootPane().putClientProperty("apple.awt.fullWindowContent", true);
|
||||
this.getRootPane().putClientProperty("apple.awt.transparentTitleBar", true);
|
||||
this.getRootPane().putClientProperty("apple.awt.fullscreenable", true);
|
||||
this.getRootPane().putClientProperty("apple.awt.windowTitleVisible", false);
|
||||
GridLayoutManager gridLayoutManager = (GridLayoutManager) contentPane.getLayout();
|
||||
gridLayoutManager.setMargin(new Insets(28, 0, 0, 0));
|
||||
}
|
||||
|
||||
ComponentUtil.setPreferSizeAndLocateToCenter(this, 600, 200);
|
||||
|
||||
buttonOK.addActionListener(e -> onOK());
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<border type="none"/>
|
||||
<children>
|
||||
<grid id="94766" layout-manager="GridLayoutManager" row-count="1" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<margin top="0" left="0" bottom="10" right="0"/>
|
||||
<constraints>
|
||||
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="1" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
|
@ -55,7 +55,7 @@
|
|||
</children>
|
||||
</grid>
|
||||
<grid id="e3588" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<margin top="10" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.luoboduner.moo.info.ui.dialog;
|
||||
|
||||
import com.formdev.flatlaf.util.SystemInfo;
|
||||
import com.intellij.uiDesigner.core.GridConstraints;
|
||||
import com.intellij.uiDesigner.core.GridLayoutManager;
|
||||
import com.intellij.uiDesigner.core.Spacer;
|
||||
|
@ -46,6 +47,15 @@ public class UpdateInfoDialog extends JDialog {
|
|||
setModal(true);
|
||||
getRootPane().setDefaultButton(buttonOK);
|
||||
|
||||
if (SystemUtil.isMacOs() && SystemInfo.isMacFullWindowContentSupported) {
|
||||
this.getRootPane().putClientProperty("apple.awt.fullWindowContent", true);
|
||||
this.getRootPane().putClientProperty("apple.awt.transparentTitleBar", true);
|
||||
this.getRootPane().putClientProperty("apple.awt.fullscreenable", true);
|
||||
this.getRootPane().putClientProperty("apple.awt.windowTitleVisible", false);
|
||||
GridLayoutManager gridLayoutManager = (GridLayoutManager) contentPane.getLayout();
|
||||
gridLayoutManager.setMargin(new Insets(28, 0, 0, 0));
|
||||
}
|
||||
|
||||
ComponentUtil.setPreferSizeAndLocateToCenter(this, 0.4, 0.64);
|
||||
|
||||
buttonOK.addActionListener(e -> onOK());
|
||||
|
|
Loading…
Reference in New Issue