Skip to content

Commit 5b35b9a

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

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
import javafx.scene.layout.Region;
2828
import javafx.stage.FileChooser;
2929
import javafx.stage.FileChooser.ExtensionFilter;
30-
import javafx.stage.Modality;
3130
import javafx.stage.Stage;
31+
import javafx.stage.StageStyle;
3232
import org.controlsfx.control.StatusBar;
3333

3434
import javax.inject.Inject;
@@ -70,6 +70,8 @@ public class MainWindowController {
7070
@Inject
7171
private Project project;
7272

73+
private Stage aboutDialogStage;
74+
7375
public void initialize() {
7476
pipelineView.prefHeightProperty().bind(bottomPane.heightProperty());
7577
statusBar.getLeftItems().add(startStoppableButtonFactory.create(pipelineRunner));
@@ -216,13 +218,16 @@ public void showProjectSettingsEditor() {
216218

217219
@FXML
218220
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();
223223
aboutDialogStage.setScene(new Scene(aboutPane));
224+
aboutDialogStage.initStyle(StageStyle.UNDECORATED);
225+
aboutDialogStage.focusedProperty().addListener((observable, oldvalue, newvalue) -> {
226+
if (oldvalue) {
227+
aboutDialogStage.hide();
228+
}
229+
});
224230
}
225-
aboutDialogStage.initModality(Modality.APPLICATION_MODAL);
226231
aboutDialogStage.show();
227232
}
228233

0 commit comments

Comments
 (0)