Merge pull request #130 from WiredSpast/master

Bugfix: Set G-Earth as owner of all alerts
This commit is contained in:
sirjonasxx 2022-07-07 23:14:47 +02:00 committed by GitHub
commit 630c43b07a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -16,6 +16,7 @@ import javafx.application.Platform;
import javafx.fxml.FXMLLoader; import javafx.fxml.FXMLLoader;
import javafx.scene.Parent; import javafx.scene.Parent;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.image.Image; import javafx.scene.image.Image;
import javafx.stage.Stage; import javafx.stage.Stage;
import javafx.stage.StageStyle; import javafx.stage.StageStyle;
@ -166,4 +167,8 @@ public class GEarth extends Application {
public static Theme getTheme() { public static Theme getTheme() {
return observableTheme.getObject(); return observableTheme.getObject();
} }
public static void setAlertOwner(Alert alert) {
alert.initOwner(main.stage);
}
} }

View File

@ -49,6 +49,7 @@ public class TitleBarController {
} }
public static TitleBarController create(Alert alert) throws IOException { public static TitleBarController create(Alert alert) throws IOException {
GEarth.setAlertOwner(alert);
FXMLLoader loader = new FXMLLoader(TitleBarController.class.getResource("Titlebar.fxml")); FXMLLoader loader = new FXMLLoader(TitleBarController.class.getResource("Titlebar.fxml"));
Parent titleBar = loader.load(); Parent titleBar = loader.load();