From b1952a7b37184d0c82ce4c98af4f7e3174a48db5 Mon Sep 17 00:00:00 2001 From: huanghongxun Date: Sat, 3 Sep 2022 22:26:05 +0800 Subject: [PATCH] fix(ui): not wrapping text. Closes #1673. --- .../hmcl/ui/construct/MultiFileItem.java | 19 ++++++------------- .../assets/fxml/download/modpack.fxml | 10 +++++----- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/MultiFileItem.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/MultiFileItem.java index a4a0c0b37..42fd95480 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/MultiFileItem.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/MultiFileItem.java @@ -165,19 +165,12 @@ public class MultiFileItem extends VBox { pane.setLeft(left); if (StringUtils.isNotBlank(subtitle)) { - Optional shortSubtitle = StringUtils.truncate(subtitle); - Label right; - if (shortSubtitle.isPresent()) { - right = new Label(shortSubtitle.get()); - right.setTooltip(new Tooltip(subtitle)); - } else { - right = new Label(subtitle); - } - BorderPane.setAlignment(right, Pos.CENTER_RIGHT); - right.setWrapText(true); - right.getStyleClass().add("subtitle-label"); - right.setStyle("-fx-font-size: 10;"); - pane.setRight(right); + Label center = new Label(subtitle); + BorderPane.setAlignment(center, Pos.CENTER_RIGHT); + center.setWrapText(true); + center.getStyleClass().add("subtitle-label"); + center.setStyle("-fx-font-size: 10;"); + pane.setCenter(center); } return pane; diff --git a/HMCL/src/main/resources/assets/fxml/download/modpack.fxml b/HMCL/src/main/resources/assets/fxml/download/modpack.fxml index bc94b28e2..1f14a18fa 100644 --- a/HMCL/src/main/resources/assets/fxml/download/modpack.fxml +++ b/HMCL/src/main/resources/assets/fxml/download/modpack.fxml @@ -17,12 +17,12 @@ - - +
+
- - - +
+
+