From d9d32eab1db1d1be3fd9a89976bc54cd3be8f598 Mon Sep 17 00:00:00 2001 From: 3gf8jv4dv <3gf8jv4dv@gmail.com> Date: Fri, 6 Jun 2025 21:56:40 +0800 Subject: [PATCH] fix(ui): refine PromptDialogPane (#3693) - Limit the dialog width to avoid too long a width - Avoid accidental blank line in the information box (That blue bg box) --- .../jackhuang/hmcl/ui/construct/PromptDialogPane.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/PromptDialogPane.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/PromptDialogPane.java index de6ec52cc..b23916321 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/PromptDialogPane.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/PromptDialogPane.java @@ -49,6 +49,7 @@ public class PromptDialogPane extends DialogPane { public PromptDialogPane(Builder builder) { this.builder = builder; setTitle(builder.title); + setPrefWidth(560); GridPane body = new GridPane(); body.setVgap(8); @@ -72,13 +73,13 @@ public class PromptDialogPane extends DialogPane { if (StringUtils.isNotBlank(question.question.get())) { body.addRow(rowIndex++, new Label(question.question.get()), textField); } else { - GridPane.setColumnSpan(textField, 2); + GridPane.setColumnSpan(textField, 1); body.addRow(rowIndex++, textField); } GridPane.setMargin(textField, new Insets(0, 0, 20, 0)); } else if (question instanceof Builder.BooleanQuestion) { HBox hBox = new HBox(); - GridPane.setColumnSpan(hBox, 2); + GridPane.setColumnSpan(hBox, 1); JFXCheckBox checkBox = new JFXCheckBox(); hBox.getChildren().setAll(checkBox); HBox.setMargin(checkBox, new Insets(0, 0, 0, -10)); @@ -95,12 +96,12 @@ public class PromptDialogPane extends DialogPane { if (StringUtils.isNotBlank(question.question.get())) { body.addRow(rowIndex++, new Label(question.question.get()), comboBox); } else { - GridPane.setColumnSpan(comboBox, 2); + GridPane.setColumnSpan(comboBox, 1); body.addRow(rowIndex++, comboBox); } } else if (question instanceof Builder.HintQuestion) { HintPane pane = new HintPane(); - GridPane.setColumnSpan(pane, 2); + GridPane.setColumnSpan(pane, 1); pane.textProperty().bind(question.question); body.addRow(rowIndex++, pane); }