mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
add move left and right context menu items to reorder wallet and transaction tabs
This commit is contained in:
parent
51ba7fc4cf
commit
bacbdb848b
1 changed files with 30 additions and 5 deletions
|
@ -1860,6 +1860,27 @@ public class AppController implements Initializable {
|
||||||
contextMenu.getItems().addAll(lock);
|
contextMenu.getItems().addAll(lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MenuItem moveRight = new MenuItem("Move Right");
|
||||||
|
moveRight.setOnAction(event -> {
|
||||||
|
int index = tabs.getTabs().indexOf(tab);
|
||||||
|
tabs.getTabs().remove(tab);
|
||||||
|
tabs.getTabs().add(index + 1, tab);
|
||||||
|
tabs.getSelectionModel().select(tab);
|
||||||
|
});
|
||||||
|
MenuItem moveLeft = new MenuItem("Move Left");
|
||||||
|
moveLeft.setOnAction(event -> {
|
||||||
|
int index = tabs.getTabs().indexOf(tab);
|
||||||
|
tabs.getTabs().remove(tab);
|
||||||
|
tabs.getTabs().add(index - 1, tab);
|
||||||
|
tabs.getSelectionModel().select(tab);
|
||||||
|
});
|
||||||
|
contextMenu.getItems().addAll(moveRight, moveLeft);
|
||||||
|
|
||||||
|
contextMenu.setOnShowing(event -> {
|
||||||
|
moveRight.setDisable(tabs.getTabs().indexOf(tab) == tabs.getTabs().size() - 1);
|
||||||
|
moveLeft.setDisable(tabs.getTabs().indexOf(tab) == 0);
|
||||||
|
});
|
||||||
|
|
||||||
MenuItem close = new MenuItem("Close");
|
MenuItem close = new MenuItem("Close");
|
||||||
close.setOnAction(event -> {
|
close.setOnAction(event -> {
|
||||||
tabs.getTabs().remove(tab);
|
tabs.getTabs().remove(tab);
|
||||||
|
@ -1877,12 +1898,16 @@ public class AppController implements Initializable {
|
||||||
tabs.getTabs().removeAll(tabs.getTabs());
|
tabs.getTabs().removeAll(tabs.getTabs());
|
||||||
});
|
});
|
||||||
|
|
||||||
MenuItem delete = new MenuItem("Delete...");
|
contextMenu.getItems().addAll(new SeparatorMenuItem(), close, closeOthers, closeAll);
|
||||||
delete.setOnAction(event -> {
|
|
||||||
deleteWallet(getSelectedWalletForm());
|
if(tab.getUserData() instanceof WalletTabData) {
|
||||||
});
|
MenuItem delete = new MenuItem("Delete...");
|
||||||
|
delete.setOnAction(event -> {
|
||||||
|
deleteWallet(getSelectedWalletForm());
|
||||||
|
});
|
||||||
|
contextMenu.getItems().addAll(new SeparatorMenuItem(), delete);
|
||||||
|
}
|
||||||
|
|
||||||
contextMenu.getItems().addAll(close, closeOthers, closeAll, delete);
|
|
||||||
return contextMenu;
|
return contextMenu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue