diff --git a/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java b/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java index 62d8666f5..aca7541e5 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultListController.java @@ -1,6 +1,7 @@ package org.cryptomator.ui.mainwindow; import javafx.beans.binding.Bindings; +import javafx.beans.binding.BooleanBinding; import javafx.beans.property.ObjectProperty; import javafx.collections.ListChangeListener; import javafx.collections.ObservableList; @@ -22,6 +23,7 @@ public class VaultListController implements FxController { private final ObservableList vaults; private final ObjectProperty selectedVault; + private final BooleanBinding noVaultSelected; private final VaultListCellFactory cellFactory; private final AddVaultWizardComponent.Builder addVaultWizard; private final RemoveVaultComponent.Builder removeVault; @@ -35,6 +37,7 @@ public class VaultListController implements FxController { this.cellFactory = cellFactory; this.addVaultWizard = addVaultWizard; this.removeVault = removeVault; + this.noVaultSelected = selectedVault.isNull(); } public void initialize() { @@ -63,4 +66,14 @@ public class VaultListController implements FxController { LOG.debug("Cannot remove a vault if none is selected."); } } + + // Getter and Setter + + public BooleanBinding noVaultSelectedProperty() { + return noVaultSelected; + } + + public boolean isNoVaultSelected() { + return noVaultSelected.get(); + } } diff --git a/main/ui/src/main/resources/fxml/vault_list.fxml b/main/ui/src/main/resources/fxml/vault_list.fxml index 25ee56c8c..f0dc86d89 100644 --- a/main/ui/src/main/resources/fxml/vault_list.fxml +++ b/main/ui/src/main/resources/fxml/vault_list.fxml @@ -1,8 +1,10 @@ + + @@ -15,7 +17,17 @@ fx:controller="org.cryptomator.ui.mainwindow.VaultListController" minWidth="206"> - + + + + + + + + + + +