optimize vaultList height update to avoid repeated bindings

This commit is contained in:
Jan-Peter Klein
2024-07-01 13:09:53 +02:00
parent 3e6204a657
commit d58307d1d6

View File

@@ -124,7 +124,7 @@ public class VaultListController implements FxController {
}
});
vaults.addListener((ListChangeListener<Vault>) _ -> vaultList.prefHeightProperty().bind(vaultList.fixedCellSizeProperty().multiply(vaultList.getItems().size())));
vaultList.prefHeightProperty().bind(Bindings.size(vaultList.getItems()).multiply(vaultList.fixedCellSizeProperty()));
selectedVault.bind(vaultList.getSelectionModel().selectedItemProperty());
vaults.addListener((ListChangeListener.Change<? extends Vault> c) -> {