From 1d18eae377d6b5e49f5f6bfc75b76f2973924bd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=9E=E5=BA=90?= <109708109+CiiLu@users.noreply.github.com> Date: Fri, 17 Apr 2026 22:20:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=8B=E8=BD=BD=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=A8=A1=E7=BB=84=20subtitle=20=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C=20(#5637)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- .../org/jackhuang/hmcl/ui/versions/DownloadListPage.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadListPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadListPage.java index 7de131b011..5601cf167a 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadListPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadListPage.java @@ -531,7 +531,6 @@ public class DownloadListPage extends Control implements DecoratorPage, VersionP listView.setSelectionModel(new NoneMultipleSelectionModel<>()); // ListViewBehavior would consume ESC pressed event, preventing us from handling it, so we ignore it here ignoreEvent(listView, KeyEvent.KEY_PRESSED, e -> e.getCode() == KeyCode.ESCAPE); - listView.setCellFactory(x -> new ListCell<>() { private static final Insets PADDING = new Insets(9, 9, 0, 9); @@ -578,7 +577,11 @@ public class DownloadListPage extends Control implements DecoratorPage, VersionP } else { ModTranslations.Mod mod = ModTranslations.getTranslationsByRepositoryType(getSkinnable().repository.getType()).getModByCurseForgeId(item.getSlug()); content.setTitle(mod != null && I18n.isUseChinese() ? mod.getDisplayName() : item.getTitle()); - content.setSubtitle(item.getDescription()); + String description = item.getDescription(); + if (description != null) { + description = description.replaceAll("\\R", " "); + } + content.setSubtitle(description); content.getTags().clear(); for (String category : item.getCategories()) { if (getSkinnable().shouldDisplayCategory(category))