mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-10 12:26:16 -04:00
Have a placeholder in the bottom of LIstPage
This commit is contained in:
parent
12b47e7d51
commit
b62f9494ae
@ -19,12 +19,13 @@ package org.jackhuang.hmcl.ui;
|
|||||||
|
|
||||||
import com.jfoenix.controls.JFXButton;
|
import com.jfoenix.controls.JFXButton;
|
||||||
import com.jfoenix.controls.JFXScrollPane;
|
import com.jfoenix.controls.JFXScrollPane;
|
||||||
|
|
||||||
import javafx.beans.binding.Bindings;
|
import javafx.beans.binding.Bindings;
|
||||||
import javafx.geometry.Insets;
|
import javafx.geometry.Insets;
|
||||||
import javafx.geometry.Pos;
|
import javafx.geometry.Pos;
|
||||||
import javafx.scene.control.ScrollPane;
|
import javafx.scene.control.ScrollPane;
|
||||||
import javafx.scene.control.SkinBase;
|
import javafx.scene.control.SkinBase;
|
||||||
|
import javafx.scene.layout.BorderPane;
|
||||||
|
import javafx.scene.layout.Pane;
|
||||||
import javafx.scene.layout.StackPane;
|
import javafx.scene.layout.StackPane;
|
||||||
import javafx.scene.layout.VBox;
|
import javafx.scene.layout.VBox;
|
||||||
import org.jackhuang.hmcl.setting.Theme;
|
import org.jackhuang.hmcl.setting.Theme;
|
||||||
@ -36,6 +37,7 @@ public class ListPageSkin extends SkinBase<ListPage<?>> {
|
|||||||
super(skinnable);
|
super(skinnable);
|
||||||
|
|
||||||
SpinnerPane spinnerPane = new SpinnerPane();
|
SpinnerPane spinnerPane = new SpinnerPane();
|
||||||
|
Pane placeholder = new Pane();
|
||||||
|
|
||||||
StackPane contentPane = new StackPane();
|
StackPane contentPane = new StackPane();
|
||||||
{
|
{
|
||||||
@ -48,9 +50,12 @@ public class ListPageSkin extends SkinBase<ListPage<?>> {
|
|||||||
list.setSpacing(10);
|
list.setSpacing(10);
|
||||||
list.setPadding(new Insets(10));
|
list.setPadding(new Insets(10));
|
||||||
|
|
||||||
|
VBox content = new VBox();
|
||||||
|
content.getChildren().setAll(list, placeholder);
|
||||||
|
|
||||||
Bindings.bindContent(list.getChildren(), skinnable.itemsProperty());
|
Bindings.bindContent(list.getChildren(), skinnable.itemsProperty());
|
||||||
|
|
||||||
scrollPane.setContent(list);
|
scrollPane.setContent(content);
|
||||||
JFXScrollPane.smoothScrolling(scrollPane);
|
JFXScrollPane.smoothScrolling(scrollPane);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +91,13 @@ public class ListPageSkin extends SkinBase<ListPage<?>> {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
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());
|
spinnerPane.loadingProperty().bind(skinnable.loadingProperty());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user