From 11c45e0ab8b9e21d11e95a8f7e476d0672ba04af Mon Sep 17 00:00:00 2001 From: Glavo Date: Thu, 9 Oct 2025 15:21:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A8=A1=E7=BB=84=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=A1=B5=E9=9D=A2=E6=A8=A1=E7=BB=84=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=9A=84=E5=B1=95=E7=A4=BA=E6=96=B9=E5=BC=8F=20(#4621)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 + .../hmcl/ui/construct/TwoLineListItem.java | 13 +- .../terracotta/TerracottaControllerPage.java | 5 +- .../hmcl/ui/versions/ModListPage.java | 107 +++++++--- .../hmcl/ui/versions/ModListPageSkin.java | 189 ++++++++++-------- .../hmcl/ui/versions/ModTranslations.java | 8 +- HMCL/src/main/resources/assets/css/root.css | 12 ++ .../resources/assets/lang/I18N.properties | 1 + .../resources/assets/lang/I18N_zh.properties | 1 + .../assets/lang/I18N_zh_CN.properties | 1 + .../org/jackhuang/hmcl/mod/ModManager.java | 20 +- 11 files changed, 230 insertions(+), 129 deletions(-) diff --git a/.gitignore b/.gitignore index 8880c9572..2316f1890 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,8 @@ NVIDIA minecraft-exported-crash-info* hmcl-exported-logs-* /.java/ +/.local/ +/.cache/ # gradle build /build/ 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 b18131fd7..0405202e3 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 @@ -33,9 +33,8 @@ import org.jackhuang.hmcl.util.AggregatedObservableList; public class TwoLineListItem extends VBox { private static final String DEFAULT_STYLE_CLASS = "two-line-list-item"; - public static Label createTagLabel(String tag) { + private static Label createTagLabel(String tag) { Label tagLabel = new Label(); - tagLabel.getStyleClass().add("tag"); tagLabel.setText(tag); HBox.setMargin(tagLabel, new Insets(0, 8, 0, 0)); return tagLabel; @@ -111,7 +110,15 @@ public class TwoLineListItem extends VBox { } public void addTag(String tag) { - getTags().add(createTagLabel(tag)); + Label tagLabel = createTagLabel(tag); + tagLabel.getStyleClass().add("tag"); + getTags().add(tagLabel); + } + + public void addTagWarning(String tag) { + Label tagLabel = createTagLabel(tag); + tagLabel.getStyleClass().add("tag-warning"); + getTags().add(tagLabel); } public ObservableList