diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TwoLineListItem.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TwoLineListItem.java index 0405202e3f..bce4803eb2 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TwoLineListItem.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TwoLineListItem.java @@ -23,6 +23,7 @@ import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.geometry.Insets; +import javafx.geometry.Pos; import javafx.scene.Node; import javafx.scene.control.Label; import javafx.scene.layout.HBox; @@ -78,8 +79,12 @@ public TwoLineListItem() { getChildren().setAll(firstLine, secondLine); FXUtils.onChangeAndOperate(subtitle, subtitleString -> { - if (subtitleString == null) getChildren().setAll(firstLine); - else getChildren().setAll(firstLine, secondLine); + if (subtitleString == null || subtitleString.isEmpty()) { + getChildren().setAll(firstLine); + setAlignment(Pos.CENTER); + } else { + getChildren().setAll(firstLine, secondLine); + } }); getStyleClass().add(DEFAULT_STYLE_CLASS);