!145 hotfix: #I85J1P 删除setStage的模态.换一种实现方法
Merge pull request !145 from Luke/hotfix-I85J1P
This commit is contained in:
commit
f01f466cef
@ -20,6 +20,7 @@ public class DeveloperDebugStage extends Stage {
|
||||
Logger logger = LogUtil.getLogger(this.getClass());
|
||||
|
||||
public void start(Stage primaryStage) {
|
||||
this.setAlwaysOnTop(true);
|
||||
// 创建主舞台
|
||||
primaryStage.setTitle("开发者调试页面");
|
||||
primaryStage.getIcons().add(UiUtil.getAppIcon());
|
||||
|
||||
@ -14,7 +14,6 @@ import javafx.scene.layout.VBox;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.text.Font;
|
||||
import javafx.scene.text.Text;
|
||||
import javafx.stage.Modality;
|
||||
import javafx.stage.Stage;
|
||||
import org.jcnc.jnotepad.app.config.AppConfig;
|
||||
import org.jcnc.jnotepad.app.i18n.UiResourceBundle;
|
||||
@ -83,7 +82,7 @@ public class SetStage extends Stage {
|
||||
primaryStage.getIcons().add(UiUtil.getAppIcon());
|
||||
primaryStage.setTitle("设置窗口");
|
||||
// 将窗口设置为模态
|
||||
primaryStage.initModality(Modality.APPLICATION_MODAL);
|
||||
//primaryStage.initModality(Modality.APPLICATION_MODAL);
|
||||
|
||||
contentDisplay = new StackPane();
|
||||
|
||||
@ -215,6 +214,7 @@ public class SetStage extends Stage {
|
||||
devBox.setButtonAction(event -> {
|
||||
// 创建并启动DeveloperDebugPage
|
||||
DeveloperDebugStage debugPage = new DeveloperDebugStage();
|
||||
debugPage.setAlwaysOnTop (true);
|
||||
debugPage.start(new Stage());
|
||||
});
|
||||
generalLayout.getChildren().addAll(devBox);
|
||||
|
||||
@ -12,6 +12,10 @@ import org.jcnc.jnotepad.component.stage.setting.SetStage;
|
||||
* @author 许轲
|
||||
*/
|
||||
public class SetBtn implements EventHandler<ActionEvent> {
|
||||
/**
|
||||
* 标志变量,跟踪Stage是否已创建
|
||||
*/
|
||||
private boolean isStageCreated = false;
|
||||
|
||||
/**
|
||||
* 打开设置窗口处理事件。
|
||||
@ -20,6 +24,11 @@ public class SetBtn implements EventHandler<ActionEvent> {
|
||||
*/
|
||||
@Override
|
||||
public void handle(ActionEvent event) {
|
||||
SetStage.getInstance().openSetStage();
|
||||
if (!isStageCreated) {
|
||||
SetStage.getInstance().openSetStage();
|
||||
// 设置标志变量为true,表示Stage已创建
|
||||
isStageCreated = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user