diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java index 6f198f6842..63db5fcd61 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java @@ -21,11 +21,12 @@ import javafx.application.Platform; import javafx.beans.property.StringProperty; import javafx.geometry.Insets; +import javafx.geometry.Pos; import javafx.scene.control.Label; -import javafx.scene.layout.BorderPane; -import javafx.scene.layout.Priority; -import javafx.scene.layout.VBox; -import org.jackhuang.hmcl.task.*; +import javafx.scene.layout.*; +import org.jackhuang.hmcl.task.FetchTask; +import org.jackhuang.hmcl.task.TaskExecutor; +import org.jackhuang.hmcl.task.TaskListener; import org.jackhuang.hmcl.ui.FXUtils; import org.jackhuang.hmcl.util.TaskCancellationAction; import org.jackhuang.hmcl.util.i18n.I18n; @@ -67,16 +68,18 @@ public TaskExecutorDialogPane(@NotNull TaskCancellationAction cancel) { center.getChildren().setAll(lblTitle, taskListPane); } - BorderPane bottom = new BorderPane(); - this.setBottom(bottom); + HBox bottom = new HBox(); + bottom.setAlignment(Pos.CENTER_LEFT); bottom.setPadding(new Insets(0, 8, 8, 8)); + bottom.setSpacing(8); + this.setBottom(bottom); { lblProgress = new Label(); - bottom.setLeft(lblProgress); - + Region spacer = new Region(); + HBox.setHgrow(spacer, Priority.ALWAYS); btnCancel = new JFXButton(i18n("button.cancel")); btnCancel.getStyleClass().add("dialog-cancel"); - bottom.setRight(btnCancel); + bottom.getChildren().setAll(lblProgress, spacer, btnCancel); } setCancel(cancel);