From 3a6ebbc006d5ad5639cacd6be01a7722b4166283 Mon Sep 17 00:00:00 2001 From: pynickle <2330458484@qq.com> Date: Thu, 8 Jan 2026 00:18:33 +0800 Subject: [PATCH] =?UTF-8?q?imp:=20=E6=B2=A1=E6=9C=89=E5=89=AF=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E6=97=B6=E4=B8=BB=E6=A0=87=E9=A2=98=E5=9E=82=E7=9B=B4?= =?UTF-8?q?=E5=B1=85=E4=B8=AD=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jackhuang/hmcl/ui/construct/TwoLineListItem.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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);