mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-04 21:36:45 +00:00
add keyboard shortcuts, fix non-mac menu exit
This commit is contained in:
parent
582065e7f0
commit
94662922a8
2 changed files with 10 additions and 9 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -15,26 +15,26 @@
|
|||
<menus>
|
||||
<Menu fx:id="fileMenu" mnemonicParsing="false" text="File">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="New Wallet" onAction="#newWallet"/>
|
||||
<MenuItem mnemonicParsing="false" text="Open Wallet..." onAction="#openWallet"/>
|
||||
<MenuItem mnemonicParsing="false" text="New Wallet" accelerator="Shortcut+N" onAction="#newWallet"/>
|
||||
<MenuItem mnemonicParsing="false" text="Open Wallet..." accelerator="Shortcut+O" onAction="#openWallet"/>
|
||||
<Menu mnemonicParsing="false" text="Open Transaction">
|
||||
<items>
|
||||
<MenuItem text="File..." onAction="#openTransactionFromFile"/>
|
||||
<MenuItem text="File..." onAction="#openTransactionFromFile" accelerator="Shortcut+T"/>
|
||||
<MenuItem fx:id="openTransactionIdItem" text="From ID..." onAction="#openTransactionFromId"/>
|
||||
<MenuItem text="From Text..." onAction="#openTransactionFromText"/>
|
||||
<MenuItem text="From QR..." onAction="#openTransactionFromQR"/>
|
||||
<!-- <MenuItem text="Examples" onAction="#openExamples"/> -->
|
||||
</items>
|
||||
</Menu>
|
||||
<MenuItem fx:id="saveTransaction" mnemonicParsing="false" text="Save Transaction..." onAction="#saveTransaction"/>
|
||||
<MenuItem fx:id="saveTransaction" mnemonicParsing="false" text="Save Transaction..." accelerator="Shortcut+S" onAction="#saveTransaction"/>
|
||||
<SeparatorMenuItem />
|
||||
<MenuItem mnemonicParsing="false" text="Import Wallet..." onAction="#importWallet"/>
|
||||
<MenuItem fx:id="exportWallet" mnemonicParsing="false" text="Export Wallet..." onAction="#exportWallet"/>
|
||||
<SeparatorMenuItem styleClass="osxHide" />
|
||||
<MenuItem styleClass="osxHide" mnemonicParsing="false" text="Preferences..." onAction="#openPreferences"/>
|
||||
<MenuItem styleClass="osxHide" mnemonicParsing="false" text="Preferences..." accelerator="Shortcut+P" onAction="#openPreferences"/>
|
||||
<SeparatorMenuItem />
|
||||
<MenuItem mnemonicParsing="false" text="Close Tab" onAction="#closeTab"/>
|
||||
<MenuItem styleClass="osxHide" mnemonicParsing="false" text="Quit" onAction="#quit"/>
|
||||
<MenuItem mnemonicParsing="false" text="Close Tab" accelerator="Shortcut+W" onAction="#closeTab"/>
|
||||
<MenuItem styleClass="osxHide" mnemonicParsing="false" text="Quit" accelerator="Shortcut+Q" onAction="#quit"/>
|
||||
</items>
|
||||
</Menu>
|
||||
<fx:define>
|
||||
|
@ -85,7 +85,7 @@
|
|||
</items>
|
||||
</Menu>
|
||||
<Menu fx:id="toolsMenu" mnemonicParsing="false" text="Tools">
|
||||
<MenuItem mnemonicParsing="false" text="Sign/Verify Message" onAction="#signVerifyMessage"/>
|
||||
<MenuItem mnemonicParsing="false" text="Sign/Verify Message" accelerator="Shortcut+M" onAction="#signVerifyMessage"/>
|
||||
</Menu>
|
||||
<Menu fx:id="helpMenu" mnemonicParsing="false" text="Help">
|
||||
<MenuItem styleClass="osxHide" mnemonicParsing="false" text="About Sparrow" onAction="#showAbout"/>
|
||||
|
|
Loading…
Reference in a new issue