Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ private static Label createTagLabel(String tag) {
private final ObservableList<Label> tags = FXCollections.observableArrayList();
private final StringProperty subtitle = new SimpleStringProperty(this, "subtitle");

private final Label lblSubtitle;
private final Label lblTitle;

private final AggregatedObservableList<Node> firstLineChildren;

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

Label lblTitle = new Label();
lblTitle = new Label();
lblTitle.getStyleClass().add("title");
lblTitle.textProperty().bind(title);

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

Label lblSubtitle = new Label();
lblSubtitle = new Label();
lblSubtitle.getStyleClass().add("subtitle");
lblSubtitle.textProperty().bind(subtitle);

Expand Down Expand Up @@ -109,6 +112,14 @@ public void setSubtitle(String subtitle) {
this.subtitle.set(subtitle);
}

public Label getSubtitleLabel() {
return lblSubtitle;
}

public Label getTitleLabel() {
return lblTitle;
}

public void addTag(String tag) {
Label tagLabel = createTagLabel(tag);
tagLabel.getStyleClass().add("tag");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ protected ModDownloadPageSkin(DownloadPage control) {
ModTranslations.Mod mod = getSkinnable().translations.getModByCurseForgeId(getSkinnable().addon.getSlug());
content.setTitle(mod != null && I18n.isUseChinese() ? mod.getDisplayName() : getSkinnable().addon.getTitle());
content.setSubtitle(getSkinnable().addon.getDescription());
content.getSubtitleLabel().setWrapText(true);
getSkinnable().addon.getCategories().stream()
.map(category -> getSkinnable().page.getLocalizedCategory(category))
.forEach(content::addTag);
Expand Down