[Enhancement] 为版本选择菜单添加了关闭动画 - #6637
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e3049b756b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| popup.getProperties().put(HIDING_KEY, true); | ||
| hideAnimated(popup); |
There was a problem hiding this comment.
Animate selection-driven dismissal too
When a user selects a game—the normal dismissal path—the Cell click handler still calls popup.hide() directly, while this new animated path is only reached from hideShowing, whose sole repository caller is the main-page menu-button toggle. Consequently, choosing a version still closes the popup instantly and the closing animation only appears when the user clicks the toggle a second time; route the selection dismissal through the animated helper as well.
Useful? React with 👍 / 👎.
# Conflicts: # HMCL/src/main/java/org/jackhuang/hmcl/ui/instances/GameListPopupMenu.java
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 00f14fba64
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Bounds popupBounds = menu.localToScreen(menu.getBoundsInLocal()); | ||
| if (popupBounds != null && !popupBounds.contains(event.getScreenX(), event.getScreenY())) { | ||
| hideAnimated(popup); |
There was a problem hiding this comment.
Exclude the toggle button from outside-click dismissal
When animations are disabled, clicking MainPage's menu button while the popup is open reaches this MOUSE_PRESSED filter before the button's action handler. hideAnimated then hides synchronously, WINDOW_HIDDEN removes KEY, and MainPage.java:262-266 sees no showing popup and immediately opens a new one, so mouse users with animations disabled cannot close the menu via its toggle button. Exclude presses on the owner from this outside-click path or retain the dismissal state until the action runs.
Useful? React with 👍 / 👎.
| owner.getProperties().put(KEY, popup); | ||
| popup.addEventFilter(WindowEvent.WINDOW_HIDDEN, event -> owner.getProperties().remove(KEY, popup)); | ||
| popup.show(owner, vAlign, hAlign, initOffsetX, initOffsetY, true); | ||
| popup.setAutoHide(false); |
There was a problem hiding this comment.
Route Escape through the animated dismissal
When a keyboard user presses Escape, JFXPopup.initialize() still leaves hideOnEscape enabled, so JavaFX calls popup.hide() directly and bypasses hideAnimated. Thus this standard dismissal path remains instantaneous despite the new closing animation; disable native Escape hiding and handle Escape by invoking the animated helper.
Useful? React with 👍 / 👎.
| if (scene != null) { | ||
| scene.addEventFilter(MouseEvent.MOUSE_PRESSED, outsideClickHandler); |
There was a problem hiding this comment.
Preserve dismissal when scrolling outside the popup
With autoHide disabled, the replacement outside-dismissal logic listens only for MOUSE_PRESSED. JavaFX's native popup auto-hide also handles outside ScrollEvent.SCROLL, so scrolling the owner scene now moves the underlying UI while leaving the game-list popup open; register the equivalent scroll filter and route it through hideAnimated as well.
Useful? React with 👍 / 👎.
2026-08-09.22-33-56.mp4