From 5c19239ddd184a8daa28b66bf9c8522e05160d96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=9E=E5=BA=90?= <109708109+CiiLu@users.noreply.github.com> Date: Sat, 21 Mar 2026 21:38:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20tag=20=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E9=80=BB=E8=BE=91=20(#5702)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit resolves #5677 --- .../org/jackhuang/hmcl/ui/construct/TwoLineListItem.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 4e559b6665..35f99b9ac0 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 @@ -17,6 +17,7 @@ */ package org.jackhuang.hmcl.ui.construct; +import javafx.beans.InvalidationListener; import javafx.beans.binding.Bindings; import javafx.beans.property.StringProperty; import javafx.beans.property.StringPropertyBase; @@ -168,11 +169,13 @@ public class TwoLineListItem extends VBox { var scrollPane = new ScrollPane(tagsBox); HBox.setHgrow(scrollPane, Priority.ALWAYS); + lblTitle.setMinWidth(Label.USE_PREF_SIZE); scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); FXUtils.onChangeAndOperate(tagsBox.heightProperty(), height -> FXUtils.setLimitHeight(scrollPane, height.doubleValue())); - scrollPane.setPrefWidth(50); firstLine.getChildren().setAll(lblTitle, scrollPane); + + tags.addListener((InvalidationListener) ignored -> scrollPane.requestLayout()); } return tags; }