Skip to content

Commit 1d18eae

Browse files
fix: 下载页面部分模组 subtitle 换行 (#5637)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 6ef04d2 commit 1d18eae

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadListPage.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,6 @@ protected ModDownloadListPageSkin(DownloadListPage control) {
531531
listView.setSelectionModel(new NoneMultipleSelectionModel<>());
532532
// ListViewBehavior would consume ESC pressed event, preventing us from handling it, so we ignore it here
533533
ignoreEvent(listView, KeyEvent.KEY_PRESSED, e -> e.getCode() == KeyCode.ESCAPE);
534-
535534
listView.setCellFactory(x -> new ListCell<>() {
536535
private static final Insets PADDING = new Insets(9, 9, 0, 9);
537536

@@ -578,7 +577,11 @@ protected void updateItem(RemoteMod item, boolean empty) {
578577
} else {
579578
ModTranslations.Mod mod = ModTranslations.getTranslationsByRepositoryType(getSkinnable().repository.getType()).getModByCurseForgeId(item.getSlug());
580579
content.setTitle(mod != null && I18n.isUseChinese() ? mod.getDisplayName() : item.getTitle());
581-
content.setSubtitle(item.getDescription());
580+
String description = item.getDescription();
581+
if (description != null) {
582+
description = description.replaceAll("\\R", " ");
583+
}
584+
content.setSubtitle(description);
582585
content.getTags().clear();
583586
for (String category : item.getCategories()) {
584587
if (getSkinnable().shouldDisplayCategory(category))

0 commit comments

Comments
 (0)