|
27 | 27 | import javafx.scene.layout.Region; |
28 | 28 | import javafx.stage.FileChooser; |
29 | 29 | import javafx.stage.FileChooser.ExtensionFilter; |
30 | | -import javafx.stage.Modality; |
31 | 30 | import javafx.stage.Stage; |
| 31 | +import javafx.stage.StageStyle; |
32 | 32 | import org.controlsfx.control.StatusBar; |
33 | 33 |
|
34 | 34 | import javax.inject.Inject; |
@@ -70,6 +70,8 @@ public class MainWindowController { |
70 | 70 | @Inject |
71 | 71 | private Project project; |
72 | 72 |
|
| 73 | + private Stage aboutDialogStage; |
| 74 | + |
73 | 75 | public void initialize() { |
74 | 76 | pipelineView.prefHeightProperty().bind(bottomPane.heightProperty()); |
75 | 77 | statusBar.getLeftItems().add(startStoppableButtonFactory.create(pipelineRunner)); |
@@ -216,13 +218,16 @@ public void showProjectSettingsEditor() { |
216 | 218 |
|
217 | 219 | @FXML |
218 | 220 | public void showProjectAboutDialog() throws IOException { |
219 | | - Stage aboutDialogStage = new Stage(); |
220 | | - if (aboutPane.getScene() != null) { |
221 | | - aboutDialogStage.setScene(aboutPane.getScene()); |
222 | | - } else { |
| 221 | + if (aboutDialogStage == null) { |
| 222 | + aboutDialogStage = new Stage(); |
223 | 223 | aboutDialogStage.setScene(new Scene(aboutPane)); |
| 224 | + aboutDialogStage.initStyle(StageStyle.UTILITY); |
| 225 | + aboutDialogStage.focusedProperty().addListener((observable, oldvalue, newvalue) -> { |
| 226 | + if (oldvalue) { |
| 227 | + aboutDialogStage.hide(); |
| 228 | + } |
| 229 | + }); |
224 | 230 | } |
225 | | - aboutDialogStage.initModality(Modality.APPLICATION_MODAL); |
226 | 231 | aboutDialogStage.show(); |
227 | 232 | } |
228 | 233 |
|
|
0 commit comments