Skip to content

Commit b6c434e

Browse files
committed
Use undecorated style and autoclose
1 parent 5ef3bd6 commit b6c434e

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

ui/src/main/java/edu/wpi/grip/ui/MainWindowController.java

+11-5
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import javafx.stage.FileChooser.ExtensionFilter;
3030
import javafx.stage.Modality;
3131
import javafx.stage.Stage;
32+
import javafx.stage.StageStyle;
3233
import org.controlsfx.control.StatusBar;
3334

3435
import javax.inject.Inject;
@@ -70,6 +71,8 @@ public class MainWindowController {
7071
@Inject
7172
private Project project;
7273

74+
private Stage aboutDialogStage;
75+
7376
public void initialize() {
7477
pipelineView.prefHeightProperty().bind(bottomPane.heightProperty());
7578
statusBar.getLeftItems().add(startStoppableButtonFactory.create(pipelineRunner));
@@ -216,13 +219,16 @@ public void showProjectSettingsEditor() {
216219

217220
@FXML
218221
public void showProjectAboutDialog() throws IOException {
219-
Stage aboutDialogStage = new Stage();
220-
if (aboutPane.getScene() != null) {
221-
aboutDialogStage.setScene(aboutPane.getScene());
222-
} else {
222+
if (aboutDialogStage == null) {
223+
aboutDialogStage = new Stage();
223224
aboutDialogStage.setScene(new Scene(aboutPane));
225+
aboutDialogStage.initStyle(StageStyle.UNDECORATED);
226+
aboutDialogStage.focusedProperty().addListener((observable, oldvalue, newvalue) -> {
227+
if (oldvalue) {
228+
aboutDialogStage.hide();
229+
}
230+
});
224231
}
225-
aboutDialogStage.initModality(Modality.APPLICATION_MODAL);
226232
aboutDialogStage.show();
227233
}
228234

0 commit comments

Comments
 (0)