From 792412b4c7dc75e296a5dadc04ba51e024effe3b Mon Sep 17 00:00:00 2001 From: Glavo Date: Fri, 6 Feb 2026 21:47:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20TwoLineListItem=20(#5447)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hmcl/ui/construct/TwoLineListItem.java | 164 +++++++++++------- HMCL/src/main/resources/assets/css/root.css | 4 +- 2 files changed, 104 insertions(+), 64 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 4e72c799a..27d22392d 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 @@ -18,126 +18,166 @@ package org.jackhuang.hmcl.ui.construct; import javafx.beans.binding.Bindings; -import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; +import javafx.beans.property.StringPropertyBase; import javafx.collections.FXCollections; import javafx.collections.ObservableList; -import javafx.geometry.Insets; -import javafx.scene.Node; import javafx.scene.control.Label; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; -import org.jackhuang.hmcl.ui.FXUtils; -import org.jackhuang.hmcl.util.AggregatedObservableList; public class TwoLineListItem extends VBox { private static final String DEFAULT_STYLE_CLASS = "two-line-list-item"; - private static Label createTagLabel(String tag) { - Label tagLabel = new Label(); - tagLabel.setText(tag); - HBox.setMargin(tagLabel, new Insets(0, 8, 0, 0)); - return tagLabel; - } + private final HBox firstLine; + private HBox secondLine; - private final StringProperty title = new SimpleStringProperty(this, "title"); - private final ObservableList