fix: listview not filled the blank

This commit is contained in:
huanghongxun
2021-09-05 19:48:45 +08:00
parent 7166a809c3
commit 8a0faa72c1
2 changed files with 5 additions and 0 deletions

View File

@@ -34,6 +34,7 @@ import javafx.scene.control.Control;
import javafx.scene.control.Label; import javafx.scene.control.Label;
import javafx.scene.control.SkinBase; import javafx.scene.control.SkinBase;
import javafx.scene.layout.HBox; import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox; import javafx.scene.layout.VBox;
import org.jackhuang.hmcl.util.javafx.MappedObservableList; import org.jackhuang.hmcl.util.javafx.MappedObservableList;
@@ -132,6 +133,9 @@ public class ComponentList extends Control {
list = MappedObservableList.create(control.getContent(), node -> { list = MappedObservableList.create(control.getContent(), node -> {
ComponentListCell cell = new ComponentListCell(node); ComponentListCell cell = new ComponentListCell(node);
cell.getStyleClass().add("options-list-item"); cell.getStyleClass().add("options-list-item");
if (node.getProperties().containsKey("vgrow")) {
VBox.setVgrow(cell, Priority.ALWAYS);
}
return cell; return cell;
}); });

View File

@@ -105,6 +105,7 @@ public final class VersionsPage extends BorderPane implements WizardPage, Refres
} else { } else {
centrePane.getContent().setAll(list); centrePane.getContent().setAll(list);
} }
list.getProperties().put("vgrow", true);
InvalidationListener listener = o -> list.getItems().setAll(loadVersions()); InvalidationListener listener = o -> list.getItems().setAll(loadVersions());
chkRelease.selectedProperty().addListener(listener); chkRelease.selectedProperty().addListener(listener);