mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-18 02:31:27 +00:00
Merge commit 'cc40d05e44780cd52757e8afa0a917dce4f5a377' into develop
fixes #79
This commit is contained in:
@@ -172,6 +172,7 @@ public class MainController implements ViewController {
|
||||
vaultList.setItems(vaults);
|
||||
vaultList.setOnKeyReleased(this::didPressKeyOnList);
|
||||
vaultList.setCellFactory(this::createDirecoryListCell);
|
||||
root.setOnKeyReleased(this::didPressKeyOnRoot);
|
||||
activeController.set(viewControllerLoader.load("/fxml/welcome.fxml"));
|
||||
selectedVault.bind(vaultList.getSelectionModel().selectedItemProperty());
|
||||
removeVaultButton.disableProperty().bind(canEditSelectedVault.not());
|
||||
@@ -409,6 +410,20 @@ public class MainController implements ViewController {
|
||||
}
|
||||
}
|
||||
|
||||
private void didPressKeyOnRoot(KeyEvent event) {
|
||||
if ((event.isMetaDown() || event.isControlDown()) && event.getCode().isDigitKey()) {
|
||||
int digit = Integer.valueOf(event.getText());
|
||||
switch (digit) {
|
||||
case 0:
|
||||
showWelcomeView();
|
||||
return;
|
||||
default:
|
||||
vaultList.getSelectionModel().select(digit - 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void didClickOnListCell(MouseEvent e) {
|
||||
if (MouseEvent.MOUSE_CLICKED.equals(e.getEventType()) && e.getSource() instanceof Cell && ((Cell<?>) e.getSource()).isSelected()) {
|
||||
activeController.get().focus();
|
||||
|
||||
Reference in New Issue
Block a user