diff --git a/src/main/java/org/cryptomator/ui/mainwindow/VaultListCellController.java b/src/main/java/org/cryptomator/ui/mainwindow/VaultListCellController.java index 38d7ed1c7..75ce21dfe 100644 --- a/src/main/java/org/cryptomator/ui/mainwindow/VaultListCellController.java +++ b/src/main/java/org/cryptomator/ui/mainwindow/VaultListCellController.java @@ -13,10 +13,16 @@ import javax.inject.Inject; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleObjectProperty; import javafx.beans.value.ObservableValue; +import javafx.fxml.FXML; +import javafx.geometry.Insets; +import javafx.scene.layout.HBox; // unscoped because each cell needs its own controller public class VaultListCellController implements FxController { + private static final Insets COMPACT_INSETS = new Insets(6, 12, 6, 12); + private static final Insets DEFAULT_INSETS = new Insets(12); + private final ObjectProperty vault = new SimpleObjectProperty<>(); private final ObservableValue glyph; private final ObservableValue compactMode; @@ -25,6 +31,8 @@ public class VaultListCellController implements FxController { /* FXML */ public FontAwesome5IconView vaultStateView; + @FXML + public HBox vaultListCell; @Inject VaultListCellController(Settings settings) { @@ -37,6 +45,7 @@ public class VaultListCellController implements FxController { .onCondition(vault.flatMap(Vault::stateProperty).map(VaultState.Value.PROCESSING::equals).orElse(false)) // .afterStop(() -> vaultStateView.setRotate(0)) // .build(); + this.vaultListCell.paddingProperty().bind(compactMode.map(c -> c ? COMPACT_INSETS : DEFAULT_INSETS)); } // TODO deduplicate w/ VaultDetailController diff --git a/src/main/resources/fxml/vault_list_cell.fxml b/src/main/resources/fxml/vault_list_cell.fxml index c6cc8cf24..20df9b924 100644 --- a/src/main/resources/fxml/vault_list_cell.fxml +++ b/src/main/resources/fxml/vault_list_cell.fxml @@ -1,22 +1,19 @@ - - - -