From 863e162c89baf76eaae10ed646f89e15dd1919d0 Mon Sep 17 00:00:00 2001 From: liuzhihang Date: Tue, 20 Aug 2024 22:02:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A8=A1=E6=9D=BF=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E7=AA=97=E5=8F=A3=E7=9A=84=E6=A8=A1=E6=80=81=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 此更改将模板设置窗口的模态类型更改为与SupportForm和SettingsForm中的模态类型保持一致。之前,TemplateSettingForm中使用了不必要的DialogWrapper.IdeModalityType.PROJECT,这与其他表单不一致。此更新确保所有表单在显示时具有相同的模态行为。 --- src/main/java/com/liuzhihang/doc/view/ui/SettingsForm.java | 2 +- src/main/java/com/liuzhihang/doc/view/ui/SupportForm.java | 6 ++++-- .../com/liuzhihang/doc/view/ui/TemplateSettingForm.java | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/liuzhihang/doc/view/ui/SettingsForm.java b/src/main/java/com/liuzhihang/doc/view/ui/SettingsForm.java index f49c652..c173b67 100644 --- a/src/main/java/com/liuzhihang/doc/view/ui/SettingsForm.java +++ b/src/main/java/com/liuzhihang/doc/view/ui/SettingsForm.java @@ -80,7 +80,7 @@ public SettingsForm(@NotNull Project project) { supportLinkLabel.setBorder(JBUI.Borders.emptyTop(20)); supportLinkLabel.setIcon(AllIcons.Actions.Find); - supportLinkLabel.setListener((source, data) -> new SupportForm().show(), null); + supportLinkLabel.setListener((source, data) -> new SupportForm(project).show(), null); initTitleBorder(); } diff --git a/src/main/java/com/liuzhihang/doc/view/ui/SupportForm.java b/src/main/java/com/liuzhihang/doc/view/ui/SupportForm.java index 27f9801..cfafcef 100644 --- a/src/main/java/com/liuzhihang/doc/view/ui/SupportForm.java +++ b/src/main/java/com/liuzhihang/doc/view/ui/SupportForm.java @@ -1,10 +1,12 @@ package com.liuzhihang.doc.view.ui; import com.intellij.ide.BrowserUtil; +import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.DialogWrapper; import com.intellij.ui.components.labels.LinkLabel; import com.intellij.util.ui.JBUI; import com.liuzhihang.doc.view.DocViewBundle; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; @@ -21,8 +23,8 @@ public class SupportForm extends DialogWrapper { private LinkLabel discussionsLinkLabel; private LinkLabel websiteLinkLabel; - public SupportForm() { - super(null, true, DialogWrapper.IdeModalityType.PROJECT); + public SupportForm(@NotNull Project project) { + super(project, true); init(); diff --git a/src/main/java/com/liuzhihang/doc/view/ui/TemplateSettingForm.java b/src/main/java/com/liuzhihang/doc/view/ui/TemplateSettingForm.java index ce8ed1b..3b59ef3 100644 --- a/src/main/java/com/liuzhihang/doc/view/ui/TemplateSettingForm.java +++ b/src/main/java/com/liuzhihang/doc/view/ui/TemplateSettingForm.java @@ -40,7 +40,7 @@ public class TemplateSettingForm extends DialogWrapper { private final Project project; public TemplateSettingForm(Project project) { - super(project, true, DialogWrapper.IdeModalityType.PROJECT); + super(project, true); this.project = project; init();