Skip to content

Commit 4b36f8c

Browse files
authored
fix: 任务窗口速度与取消未对齐 (HMCL-dev#6140)
1 parent 5c0baad commit 4b36f8c

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TaskExecutorDialogPane.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@
2121
import javafx.application.Platform;
2222
import javafx.beans.property.StringProperty;
2323
import javafx.geometry.Insets;
24+
import javafx.geometry.Pos;
2425
import javafx.scene.control.Label;
25-
import javafx.scene.layout.BorderPane;
26-
import javafx.scene.layout.Priority;
27-
import javafx.scene.layout.VBox;
28-
import org.jackhuang.hmcl.task.*;
26+
import javafx.scene.layout.*;
27+
import org.jackhuang.hmcl.task.FetchTask;
28+
import org.jackhuang.hmcl.task.TaskExecutor;
29+
import org.jackhuang.hmcl.task.TaskListener;
2930
import org.jackhuang.hmcl.ui.FXUtils;
3031
import org.jackhuang.hmcl.util.TaskCancellationAction;
3132
import org.jackhuang.hmcl.util.i18n.I18n;
@@ -67,16 +68,18 @@ public TaskExecutorDialogPane(@NotNull TaskCancellationAction cancel) {
6768
center.getChildren().setAll(lblTitle, taskListPane);
6869
}
6970

70-
BorderPane bottom = new BorderPane();
71-
this.setBottom(bottom);
71+
HBox bottom = new HBox();
72+
bottom.setAlignment(Pos.CENTER_LEFT);
7273
bottom.setPadding(new Insets(0, 8, 8, 8));
74+
bottom.setSpacing(8);
75+
this.setBottom(bottom);
7376
{
7477
lblProgress = new Label();
75-
bottom.setLeft(lblProgress);
76-
78+
Region spacer = new Region();
79+
HBox.setHgrow(spacer, Priority.ALWAYS);
7780
btnCancel = new JFXButton(i18n("button.cancel"));
7881
btnCancel.getStyleClass().add("dialog-cancel");
79-
bottom.setRight(btnCancel);
82+
bottom.getChildren().setAll(lblProgress, spacer, btnCancel);
8083
}
8184

8285
setCancel(cancel);

0 commit comments

Comments
 (0)