fix(ui): 修复版本列表为空时显示的问题 (#3944)

This commit is contained in:
General_K1ng 2025-05-29 19:26:42 +08:00 committed by GitHub
parent 5ab75b6a84
commit f223d2bc41
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -321,6 +321,14 @@ public final class MainPage extends StackPane implements DecoratorPage {
}
private void onMenu() {
if (menu.getContent().isEmpty()) {
Label placeholder = new Label(i18n("version.empty"));
placeholder.setStyle("-fx-padding: 10px; -fx-text-fill: gray; -fx-font-style: italic;");
popup.setPopupContent(placeholder);
} else {
popup.setPopupContent(menu);
}
popup.show(menuButton, JFXPopup.PopupVPosition.BOTTOM, JFXPopup.PopupHPosition.RIGHT, 0, -menuButton.getHeight());
}