Skip to content

[Enhancement] 为版本选择菜单添加了关闭动画 - #6637

Open
cow76192 wants to merge 5 commits into
HMCL-dev:mainfrom
cow76192:main
Open

[Enhancement] 为版本选择菜单添加了关闭动画#6637
cow76192 wants to merge 5 commits into
HMCL-dev:mainfrom
cow76192:main

Conversation

@cow76192

@cow76192 cow76192 commented Aug 9, 2026

Copy link
Copy Markdown
2026-08-09.22-33-56.mp4

@github-actions github-actions Bot added the 40+ label Aug 9, 2026
@cow76192 cow76192 changed the title [Enhancement] add animated hiding functionality for game list popup menu [Enhancement] 为版本选择菜单添加了关闭动画 Aug 10, 2026
@Glavo

Glavo commented Aug 14, 2026

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +116 to +117
popup.getProperties().put(HIDING_KEY, true);
hideAnimated(popup);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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
@github-actions github-actions Bot added 100+ and removed 40+ labels Aug 15, 2026
@Glavo

Glavo commented Aug 15, 2026

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +145 to +147
Bounds popupBounds = menu.localToScreen(menu.getBoundsInLocal());
if (popupBounds != null && !popupBounds.contains(event.getScreenX(), event.getScreenY())) {
hideAnimated(popup);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment on lines +158 to +159
if (scene != null) {
scene.addEventFilter(MouseEvent.MOUSE_PRESSED, outsideClickHandler);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants