mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-23 00:40:51 +01:00
Set G-Earth as owner of all alerts
This commit is contained in:
parent
e5626ad587
commit
5a713414a3
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user