From 94662922a87e75abd27738ade34de1b40ffa3bde Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 10 Dec 2020 08:38:55 +0200 Subject: [PATCH] add keyboard shortcuts, fix non-mac menu exit --- .../com/sparrowwallet/sparrow/AppController.java | 3 ++- .../resources/com/sparrowwallet/sparrow/app.fxml | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index 0cec90b4..32c8f3ec 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -235,6 +235,7 @@ public class AppController implements Initializable { MenuToolkit tk = MenuToolkit.toolkit(); MenuItem preferences = new MenuItem("Preferences..."); preferences.setOnAction(this::openPreferences); + preferences.setAccelerator(new KeyCodeCombination(KeyCode.COMMA, KeyCombination.META_DOWN)); Menu defaultApplicationMenu = new Menu("Apple", null, tk.createAboutMenuItem(MainApp.APP_NAME, getAboutStage()), new SeparatorMenuItem(), preferences, new SeparatorMenuItem(), tk.createHideMenuItem(MainApp.APP_NAME), tk.createHideOthersMenuItem(), tk.createUnhideAllMenuItem(), new SeparatorMenuItem(), @@ -483,7 +484,7 @@ public class AppController implements Initializable { public void quit(ActionEvent event) { try { - AppServices.get().getApplication().stop(); + Platform.exit(); } catch (Exception e) { log.error("Error quitting application", e); } diff --git a/src/main/resources/com/sparrowwallet/sparrow/app.fxml b/src/main/resources/com/sparrowwallet/sparrow/app.fxml index 1ba0eac3..0030ee62 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/app.fxml +++ b/src/main/resources/com/sparrowwallet/sparrow/app.fxml @@ -15,26 +15,26 @@ - - + + - + - + - + - - + + @@ -85,7 +85,7 @@ - +