Skip to content

Commit d9d32ea

Browse files
authored
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)
1 parent 24bb630 commit d9d32ea

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public class PromptDialogPane extends DialogPane {
4949
public PromptDialogPane(Builder builder) {
5050
this.builder = builder;
5151
setTitle(builder.title);
52+
setPrefWidth(560);
5253

5354
GridPane body = new GridPane();
5455
body.setVgap(8);
@@ -72,13 +73,13 @@ public PromptDialogPane(Builder builder) {
7273
if (StringUtils.isNotBlank(question.question.get())) {
7374
body.addRow(rowIndex++, new Label(question.question.get()), textField);
7475
} else {
75-
GridPane.setColumnSpan(textField, 2);
76+
GridPane.setColumnSpan(textField, 1);
7677
body.addRow(rowIndex++, textField);
7778
}
7879
GridPane.setMargin(textField, new Insets(0, 0, 20, 0));
7980
} else if (question instanceof Builder.BooleanQuestion) {
8081
HBox hBox = new HBox();
81-
GridPane.setColumnSpan(hBox, 2);
82+
GridPane.setColumnSpan(hBox, 1);
8283
JFXCheckBox checkBox = new JFXCheckBox();
8384
hBox.getChildren().setAll(checkBox);
8485
HBox.setMargin(checkBox, new Insets(0, 0, 0, -10));
@@ -95,12 +96,12 @@ public PromptDialogPane(Builder builder) {
9596
if (StringUtils.isNotBlank(question.question.get())) {
9697
body.addRow(rowIndex++, new Label(question.question.get()), comboBox);
9798
} else {
98-
GridPane.setColumnSpan(comboBox, 2);
99+
GridPane.setColumnSpan(comboBox, 1);
99100
body.addRow(rowIndex++, comboBox);
100101
}
101102
} else if (question instanceof Builder.HintQuestion) {
102103
HintPane pane = new HintPane();
103-
GridPane.setColumnSpan(pane, 2);
104+
GridPane.setColumnSpan(pane, 1);
104105
pane.textProperty().bind(question.question);
105106
body.addRow(rowIndex++, pane);
106107
}

0 commit comments

Comments
 (0)