fixed empty vaultList contextMenu

This commit is contained in:
Jan-Peter Klein 2024-10-09 16:55:56 +02:00
parent 44310cbd0e
commit 118a1411d8
No known key found for this signature in database
GPG Key ID: 90EDA3A7C822FD0E
2 changed files with 12 additions and 5 deletions

View File

@ -112,6 +112,10 @@ public class VaultListController implements FxController {
vaultList.setItems(vaults);
vaultList.setCellFactory(cellFactory);
vaultList.prefHeightProperty().bind(
vaultList.fixedCellSizeProperty().multiply(Bindings.size(vaultList.getItems()))
);
selectedVault.bind(vaultList.getSelectionModel().selectedItemProperty());
vaults.addListener((ListChangeListener.Change<? extends Vault> c) -> {
while (c.next()) {

View File

@ -18,11 +18,14 @@
minWidth="206">
<VBox>
<StackPane VBox.vgrow="ALWAYS">
<ListView fx:id="vaultList" editable="true" fixedCellSize="${controller.cellSize}">
<contextMenu>
<fx:include source="vault_list_contextmenu.fxml"/>
</contextMenu>
</ListView>
<VBox>
<ListView fx:id="vaultList" editable="true" fixedCellSize="${controller.cellSize}">
<contextMenu>
<fx:include source="vault_list_contextmenu.fxml"/>
</contextMenu>
</ListView>
<Region VBox.vgrow="ALWAYS" styleClass="list-view"/>
</VBox>
<VBox visible="${controller.emptyVaultList}" spacing="6" alignment="CENTER">
<Region VBox.vgrow="ALWAYS"/>
<Label VBox.vgrow="NEVER" text="%main.vaultlist.emptyList.onboardingInstruction" textAlignment="CENTER" wrapText="true"/>