From b62f9494ae868ee39768d75a696f054550e3a247 Mon Sep 17 00:00:00 2001 From: huanghongxun Date: Tue, 12 Feb 2019 21:39:01 +0800 Subject: [PATCH] Have a placeholder in the bottom of LIstPage --- .../org/jackhuang/hmcl/ui/ListPageSkin.java | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/ListPageSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/ListPageSkin.java index 1e8cc6897..887afa40c 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/ListPageSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/ListPageSkin.java @@ -19,12 +19,13 @@ package org.jackhuang.hmcl.ui; import com.jfoenix.controls.JFXButton; import com.jfoenix.controls.JFXScrollPane; - import javafx.beans.binding.Bindings; import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.scene.control.ScrollPane; import javafx.scene.control.SkinBase; +import javafx.scene.layout.BorderPane; +import javafx.scene.layout.Pane; import javafx.scene.layout.StackPane; import javafx.scene.layout.VBox; import org.jackhuang.hmcl.setting.Theme; @@ -36,6 +37,7 @@ public class ListPageSkin extends SkinBase> { super(skinnable); SpinnerPane spinnerPane = new SpinnerPane(); + Pane placeholder = new Pane(); StackPane contentPane = new StackPane(); { @@ -48,9 +50,12 @@ public class ListPageSkin extends SkinBase> { list.setSpacing(10); list.setPadding(new Insets(10)); + VBox content = new VBox(); + content.getChildren().setAll(list, placeholder); + Bindings.bindContent(list.getChildren(), skinnable.itemsProperty()); - scrollPane.setContent(list); + scrollPane.setContent(content); JFXScrollPane.smoothScrolling(scrollPane); } @@ -86,7 +91,13 @@ public class ListPageSkin extends SkinBase> { }); } - contentPane.getChildren().setAll(scrollPane, vBox); + // Keep a blank space to prevent buttons from blocking up mod items. + BorderPane group = new BorderPane(); + group.setPickOnBounds(false); + group.setBottom(vBox); + placeholder.minHeightProperty().bind(vBox.heightProperty()); + + contentPane.getChildren().setAll(scrollPane, group); } spinnerPane.loadingProperty().bind(skinnable.loadingProperty());