Skip to content

Commit f223d2b

Browse files
authored
fix(ui): 修复版本列表为空时显示的问题 (#3944)
1 parent 5ab75b6 commit f223d2b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

HMCL/src/main/java/org/jackhuang/hmcl/ui/main/MainPage.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,14 @@ private void launch() {
321321
}
322322

323323
private void onMenu() {
324+
if (menu.getContent().isEmpty()) {
325+
Label placeholder = new Label(i18n("version.empty"));
326+
placeholder.setStyle("-fx-padding: 10px; -fx-text-fill: gray; -fx-font-style: italic;");
327+
328+
popup.setPopupContent(placeholder);
329+
} else {
330+
popup.setPopupContent(menu);
331+
}
324332
popup.show(menuButton, JFXPopup.PopupVPosition.BOTTOM, JFXPopup.PopupHPosition.RIGHT, 0, -menuButton.getHeight());
325333
}
326334

0 commit comments

Comments
 (0)