Skip to content

Commit 0fbed48

Browse files
committed
update
1 parent 35e6592 commit 0fbed48

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TwoLineListItem.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ private static Label createTagLabel(String tag) {
4444
private final ObservableList<Label> tags = FXCollections.observableArrayList();
4545
private final StringProperty subtitle = new SimpleStringProperty(this, "subtitle");
4646

47+
private final Label lblSubtitle;
48+
private final Label lblTitle;
49+
4750
private final AggregatedObservableList<Node> firstLineChildren;
4851

4952
public TwoLineListItem(String titleString, String subtitleString) {
@@ -59,7 +62,7 @@ public TwoLineListItem() {
5962
HBox firstLine = new HBox();
6063
firstLine.getStyleClass().add("first-line");
6164

62-
Label lblTitle = new Label();
65+
lblTitle = new Label();
6366
lblTitle.getStyleClass().add("title");
6467
lblTitle.textProperty().bind(title);
6568

@@ -68,7 +71,7 @@ public TwoLineListItem() {
6871
firstLineChildren.appendList(tags);
6972
Bindings.bindContent(firstLine.getChildren(), firstLineChildren.getAggregatedList());
7073

71-
Label lblSubtitle = new Label();
74+
lblSubtitle = new Label();
7275
lblSubtitle.getStyleClass().add("subtitle");
7376
lblSubtitle.textProperty().bind(subtitle);
7477

@@ -109,6 +112,14 @@ public void setSubtitle(String subtitle) {
109112
this.subtitle.set(subtitle);
110113
}
111114

115+
public Label getSubtitleLabel() {
116+
return lblSubtitle;
117+
}
118+
119+
public Label getTitleLabel() {
120+
return lblTitle;
121+
}
122+
112123
public void addTag(String tag) {
113124
Label tagLabel = createTagLabel(tag);
114125
tagLabel.getStyleClass().add("tag");

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ protected ModDownloadPageSkin(DownloadPage control) {
230230
ModTranslations.Mod mod = getSkinnable().translations.getModByCurseForgeId(getSkinnable().addon.getSlug());
231231
content.setTitle(mod != null && I18n.isUseChinese() ? mod.getDisplayName() : getSkinnable().addon.getTitle());
232232
content.setSubtitle(getSkinnable().addon.getDescription());
233+
content.getSubtitleLabel().setWrapText(true);
233234
getSkinnable().addon.getCategories().stream()
234235
.map(category -> getSkinnable().page.getLocalizedCategory(category))
235236
.forEach(content::addTag);

0 commit comments

Comments
 (0)