diff --git a/pdfsam-gui/src/main/java/org/pdfsam/gui/components/dialog/ConfirmationDialog.java b/pdfsam-gui/src/main/java/org/pdfsam/gui/components/dialog/ConfirmationDialog.java index 2fb76aaf..e7b284a6 100644 --- a/pdfsam-gui/src/main/java/org/pdfsam/gui/components/dialog/ConfirmationDialog.java +++ b/pdfsam-gui/src/main/java/org/pdfsam/gui/components/dialog/ConfirmationDialog.java @@ -18,6 +18,7 @@ */ package org.pdfsam.gui.components.dialog; +import javafx.application.Platform; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.HBox; @@ -42,7 +43,6 @@ public class ConfirmationDialog extends Stage { public ConfirmationDialog(DialogStyle style, Stage owner, String positiveButtonText, String negativeButtonText) { initModality(Modality.WINDOW_MODAL); initStyle(StageStyle.UTILITY); - setResizable(false); initOwner(owner); this.dialogContent = new ConfirmationDialogContent(style.icon); VBox containerPane = new VBox(); @@ -55,6 +55,10 @@ public ConfirmationDialog(DialogStyle style, Stage owner, String positiveButtonT Scene scene = new Scene(containerPane); setScene(scene); app().registerScene(scene); + Platform.runLater(() -> { + scene.getWindow().sizeToScene(); + setResizable(false); + }); this.setOnShown(e -> requestFocus()); } diff --git a/pdfsam-gui/src/main/java/org/pdfsam/gui/components/dialog/OpenWithDialog.java b/pdfsam-gui/src/main/java/org/pdfsam/gui/components/dialog/OpenWithDialog.java index 53a6208a..a3be0519 100644 --- a/pdfsam-gui/src/main/java/org/pdfsam/gui/components/dialog/OpenWithDialog.java +++ b/pdfsam-gui/src/main/java/org/pdfsam/gui/components/dialog/OpenWithDialog.java @@ -20,6 +20,7 @@ import jakarta.inject.Inject; import jakarta.inject.Named; +import javafx.application.Platform; import javafx.collections.FXCollections; import javafx.geometry.Pos; import javafx.scene.Scene; @@ -71,7 +72,6 @@ public OpenWithDialog(@Named("primaryStage") Stage stage) { OpenWithDialog(Collection tools, @Named("primaryStage") Stage stage) { initModality(Modality.WINDOW_MODAL); initStyle(StageStyle.UTILITY); - setResizable(false); setTitle(i18n().tr("Open with")); initOwner(stage); @@ -97,6 +97,10 @@ public OpenWithDialog(@Named("primaryStage") Stage stage) { setScene(scene); app().registerScene(scene); eventStudio().addAnnotatedListeners(this); + Platform.runLater(() -> { + scene.getWindow().sizeToScene(); + setResizable(false); + }); this.setOnShown(e -> requestFocus()); } diff --git a/pdfsam-gui/src/main/java/org/pdfsam/gui/components/dialog/OverwriteConfirmationDialog.java b/pdfsam-gui/src/main/java/org/pdfsam/gui/components/dialog/OverwriteConfirmationDialog.java index 9be2ccf6..47645a1e 100644 --- a/pdfsam-gui/src/main/java/org/pdfsam/gui/components/dialog/OverwriteConfirmationDialog.java +++ b/pdfsam-gui/src/main/java/org/pdfsam/gui/components/dialog/OverwriteConfirmationDialog.java @@ -20,6 +20,7 @@ import jakarta.inject.Inject; import jakarta.inject.Named; +import javafx.application.Platform; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.layout.HBox; @@ -51,7 +52,6 @@ public class OverwriteConfirmationDialog extends Stage { public OverwriteConfirmationDialog(@Named("primaryStage") Stage stage) { initModality(Modality.WINDOW_MODAL); initStyle(StageStyle.UTILITY); - setResizable(false); initOwner(stage); this.dialogContent = new ConfirmationDialogContent(DialogStyle.WARNING.icon); VBox containerPane = new VBox(); @@ -62,6 +62,10 @@ public OverwriteConfirmationDialog(@Named("primaryStage") Stage stage) { Scene scene = new Scene(containerPane); setScene(scene); app().registerScene(scene); + Platform.runLater(() -> { + scene.getWindow().sizeToScene(); + setResizable(false); + }); this.setOnShown(e -> requestFocus()); }