Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support quick access to top nav items with Alt 1–9 keyboard shortcuts #1302

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 28 additions & 8 deletions gui/src/main/java/io/bisq/gui/main/MainView.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,17 +151,37 @@ protected void initialize() {
daoButton.setManaged(false);
}

// TODO can be removed once DAO is released
if (BisqEnvironment.getBaseCurrencyNetwork().isBitcoin()) {
UserThread.runAfter(() -> {
root.getScene().addEventHandler(KeyEvent.KEY_RELEASED, keyEvent -> {
if (Utilities.isAltOrCtrlPressed(KeyCode.D, keyEvent)) {
UserThread.runAfter(() -> {
root.getScene().addEventHandler(KeyEvent.KEY_RELEASED, keyEvent -> {
// TODO can be removed once DAO is released
if (Utilities.isAltOrCtrlPressed(KeyCode.D, keyEvent)) {
if (BisqEnvironment.getBaseCurrencyNetwork().isBitcoin()) {
daoButton.setVisible(true);
daoButton.setManaged(true);
}
});
}, 1);
}
} else if (Utilities.isAltOrCtrlPressed(KeyCode.DIGIT1, keyEvent)) {
marketButton.fire();
} else if (Utilities.isAltOrCtrlPressed(KeyCode.DIGIT2, keyEvent)) {
buyButton.fire();
} else if (Utilities.isAltOrCtrlPressed(KeyCode.DIGIT3, keyEvent)) {
sellButton.fire();
} else if (Utilities.isAltOrCtrlPressed(KeyCode.DIGIT4, keyEvent)) {
portfolioButton.fire();
} else if (Utilities.isAltOrCtrlPressed(KeyCode.DIGIT5, keyEvent)) {
fundsButton.fire();
} else if (Utilities.isAltOrCtrlPressed(KeyCode.DIGIT6, keyEvent)) {
disputesButton.fire();
} else if (Utilities.isAltOrCtrlPressed(KeyCode.DIGIT7, keyEvent)) {
settingsButton.fire();
} else if (Utilities.isAltOrCtrlPressed(KeyCode.DIGIT8, keyEvent)) {
accountButton.fire();
} else if (Utilities.isAltOrCtrlPressed(KeyCode.DIGIT9, keyEvent)) {
if (daoButton.isVisible()) {
daoButton.fire();
}
}
});
}, 1);

HBox leftNavPane = new HBox(marketButton, buyButton, sellButton, portfolioButtonHolder, fundsButton, disputesButtonHolder) {{
setLeftAnchor(this, 10d);
Expand Down