From 78be1aaa7cade0714c32eaefe18800bbbaa84a0c Mon Sep 17 00:00:00 2001 From: huanghongxun Date: Mon, 18 Mar 2019 13:43:17 +0800 Subject: [PATCH] Fix blank space in bottom of settings page --- .../org/jackhuang/hmcl/ui/SettingsView.java | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/SettingsView.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/SettingsView.java index e56f6d46d..27222ba7b 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/SettingsView.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/SettingsView.java @@ -19,6 +19,7 @@ package org.jackhuang.hmcl.ui; import com.jfoenix.controls.*; import javafx.geometry.HPos; +import javafx.geometry.Insets; import javafx.geometry.Pos; import javafx.geometry.VPos; import javafx.scene.Cursor; @@ -72,7 +73,7 @@ public abstract class SettingsView extends StackPane { { VBox rootPane = new VBox(); - rootPane.setStyle("-fx-padding: 18;"); + rootPane.setPadding(new Insets(36, 18, 36, 18)); { ComponentList settingsPane = new ComponentList(); { @@ -80,12 +81,31 @@ public abstract class SettingsView extends StackPane { StackPane sponsorPane = new StackPane(); sponsorPane.setCursor(Cursor.HAND); sponsorPane.setOnMouseClicked(e -> onSponsor()); + + GridPane gridPane = new GridPane(); + + ColumnConstraints col = new ColumnConstraints(); + col.setHgrow(Priority.SOMETIMES); + col.setMaxWidth(Double.POSITIVE_INFINITY); + + gridPane.getColumnConstraints().setAll(col); + + RowConstraints row = new RowConstraints(); + row.setMinHeight(Double.NEGATIVE_INFINITY); + row.setValignment(VPos.TOP); + row.setVgrow(Priority.SOMETIMES); + gridPane.getRowConstraints().setAll(row); + { Label label = new Label(i18n("sponsor.hmcl")); label.setWrapText(true); - label.prefWidthProperty().bind(sponsorPane.widthProperty()); - sponsorPane.getChildren().add(label); + label.setTextAlignment(TextAlignment.JUSTIFY); + GridPane.setRowIndex(label, 0); + GridPane.setColumnIndex(label, 0); + gridPane.getChildren().add(label); } + + sponsorPane.getChildren().setAll(gridPane); settingsPane.getContent().add(sponsorPane); }