diff --git a/app/src/main/java/io/xpipe/app/browser/fs/OpenFileSystemComp.java b/app/src/main/java/io/xpipe/app/browser/fs/OpenFileSystemComp.java index bfd18bb1..e822892a 100644 --- a/app/src/main/java/io/xpipe/app/browser/fs/OpenFileSystemComp.java +++ b/app/src/main/java/io/xpipe/app/browser/fs/OpenFileSystemComp.java @@ -119,13 +119,13 @@ public class OpenFileSystemComp extends SimpleComp { }); InputHelper.onKeyCombination( - root, new KeyCodeCombination(KeyCode.F, KeyCombination.CONTROL_DOWN), true, keyEvent -> { + root, new KeyCodeCombination(KeyCode.F, KeyCombination.SHORTCUT_DOWN), true, keyEvent -> { filter.toggleButton().fire(); filter.textField().requestFocus(); keyEvent.consume(); }); InputHelper.onKeyCombination( - root, new KeyCodeCombination(KeyCode.L, KeyCombination.CONTROL_DOWN), true, keyEvent -> { + root, new KeyCodeCombination(KeyCode.L, KeyCombination.SHORTCUT_DOWN), true, keyEvent -> { navBar.textField().requestFocus(); keyEvent.consume(); }); diff --git a/app/src/main/java/io/xpipe/app/browser/session/BrowserSessionTabsComp.java b/app/src/main/java/io/xpipe/app/browser/session/BrowserSessionTabsComp.java index dd5ab587..f4d3482b 100644 --- a/app/src/main/java/io/xpipe/app/browser/session/BrowserSessionTabsComp.java +++ b/app/src/main/java/io/xpipe/app/browser/session/BrowserSessionTabsComp.java @@ -220,7 +220,7 @@ public class BrowserSessionTabsComp extends SimpleComp { } } - var forward = new KeyCodeCombination(KeyCode.TAB, KeyCombination.CONTROL_DOWN); + var forward = new KeyCodeCombination(KeyCode.TAB, KeyCombination.SHORTCUT_DOWN); if (forward.match(keyEvent)) { var next = (tabs.getSelectionModel().getSelectedIndex() + 1) % tabs.getTabs().size(); @@ -229,7 +229,7 @@ public class BrowserSessionTabsComp extends SimpleComp { return; } - var back = new KeyCodeCombination(KeyCode.TAB, KeyCombination.CONTROL_DOWN, KeyCombination.SHIFT_DOWN); + var back = new KeyCodeCombination(KeyCode.TAB, KeyCombination.SHORTCUT_DOWN, KeyCombination.SHIFT_DOWN); if (back.match(keyEvent)) { var previous = (tabs.getTabs().size() + tabs.getSelectionModel().getSelectedIndex() - 1) % tabs.getTabs().size(); diff --git a/app/src/main/java/io/xpipe/app/comp/AppLayoutComp.java b/app/src/main/java/io/xpipe/app/comp/AppLayoutComp.java index 89ced064..32c419d3 100644 --- a/app/src/main/java/io/xpipe/app/comp/AppLayoutComp.java +++ b/app/src/main/java/io/xpipe/app/comp/AppLayoutComp.java @@ -13,6 +13,7 @@ import io.xpipe.app.storage.DataStorage; import javafx.beans.binding.Bindings; import javafx.beans.value.ObservableValue; +import javafx.scene.Parent; import javafx.scene.control.ButtonBase; import javafx.scene.input.KeyCodeCombination; import javafx.scene.input.KeyEvent; @@ -61,7 +62,7 @@ public class AppLayoutComp extends Comp> { sidebarR.getChildrenUnmodifiable().forEach(node -> { var shortcut = (KeyCodeCombination) node.getProperties().get("shortcut"); if (shortcut != null && shortcut.match(event)) { - ((ButtonBase) node).fire(); + ((ButtonBase) ((Parent) node).getChildrenUnmodifiable().get(1)).fire(); event.consume(); return; } diff --git a/app/src/main/java/io/xpipe/app/comp/base/SideMenuBarComp.java b/app/src/main/java/io/xpipe/app/comp/base/SideMenuBarComp.java index 89dcbf63..2eb671cf 100644 --- a/app/src/main/java/io/xpipe/app/comp/base/SideMenuBarComp.java +++ b/app/src/main/java/io/xpipe/app/comp/base/SideMenuBarComp.java @@ -71,9 +71,6 @@ public class SideMenuBarComp extends Comp> { value.setValue(e); }); var shortcut = e.combination(); - if (shortcut != null) { - b.apply(struc -> struc.get().getProperties().put("shortcut", shortcut)); - } b.apply(new TooltipAugment<>(e.name(), shortcut)); b.apply(struc -> { AppFont.setSize(struc.get(), 1); @@ -112,6 +109,9 @@ public class SideMenuBarComp extends Comp> { selectedBorder, noneBorder)); }); + if (shortcut != null) { + stack.apply(struc -> struc.get().getProperties().put("shortcut", shortcut)); + } vbox.getChildren().add(stack.createRegion()); } diff --git a/app/src/main/java/io/xpipe/app/core/AppLayoutModel.java b/app/src/main/java/io/xpipe/app/core/AppLayoutModel.java index ac071ba4..b58fb9e2 100644 --- a/app/src/main/java/io/xpipe/app/core/AppLayoutModel.java +++ b/app/src/main/java/io/xpipe/app/core/AppLayoutModel.java @@ -78,19 +78,19 @@ public class AppLayoutModel { "mdi2f-file-cabinet", new BrowserSessionComp(BrowserSessionModel.DEFAULT), null, - new KeyCodeCombination(KeyCode.DIGIT1, KeyCombination.CONTROL_DOWN)), + new KeyCodeCombination(KeyCode.DIGIT1, KeyCombination.SHORTCUT_DOWN)), new Entry( AppI18n.observable("connections"), "mdi2c-connection", new StoreLayoutComp(), null, - new KeyCodeCombination(KeyCode.DIGIT2, KeyCombination.CONTROL_DOWN)), + new KeyCodeCombination(KeyCode.DIGIT2, KeyCombination.SHORTCUT_DOWN)), new Entry( AppI18n.observable("settings"), "mdsmz-miscellaneous_services", new AppPrefsComp(), null, - new KeyCodeCombination(KeyCode.DIGIT3, KeyCombination.CONTROL_DOWN)), + new KeyCodeCombination(KeyCode.DIGIT3, KeyCombination.SHORTCUT_DOWN)), new Entry( AppI18n.observable("explorePlans"), "mdi2p-professional-hexagon", @@ -102,20 +102,20 @@ public class AppLayoutModel { "mdi2g-github", null, () -> Hyperlinks.open(Hyperlinks.GITHUB), - new KeyCodeCombination(KeyCode.DIGIT3, KeyCombination.CONTROL_DOWN)), + null), new Entry( AppI18n.observable("discord"), "mdi2d-discord", null, () -> Hyperlinks.open(Hyperlinks.DISCORD), - new KeyCodeCombination(KeyCode.DIGIT3, KeyCombination.CONTROL_DOWN)), + null), new Entry( AppI18n.observable("api"), "mdi2c-code-json", null, () -> Hyperlinks.open( "http://localhost:" + AppBeaconServer.get().getPort()), - new KeyCodeCombination(KeyCode.DIGIT3, KeyCombination.CONTROL_DOWN)))); + null))); return l; }