mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 07:30:24 +00:00
Input fixes [release]
This commit is contained in:
parent
f0a91e09c5
commit
3357c73aea
5 changed files with 15 additions and 14 deletions
|
@ -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();
|
||||
});
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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<CompStructure<Pane>> {
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -71,9 +71,6 @@ public class SideMenuBarComp extends Comp<CompStructure<VBox>> {
|
|||
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<CompStructure<VBox>> {
|
|||
selectedBorder,
|
||||
noneBorder));
|
||||
});
|
||||
if (shortcut != null) {
|
||||
stack.apply(struc -> struc.get().getProperties().put("shortcut", shortcut));
|
||||
}
|
||||
vbox.getChildren().add(stack.createRegion());
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue