Skip to content

[Bugfix] 修复右上角按钮和对话框图层相对位置错误的问题#6194

Open
ToobLac wants to merge 11 commits into
HMCL-dev:mainfrom
ToobLac:fix-5796
Open

[Bugfix] 修复右上角按钮和对话框图层相对位置错误的问题#6194
ToobLac wants to merge 11 commits into
HMCL-dev:mainfrom
ToobLac:fix-5796

Conversation

@ToobLac

@ToobLac ToobLac commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

现在对话框在右上角三个按钮之上,而阴影背景在三个按钮之下,所以遮挡关系是正确的且能正常点击按钮

Fixes #5796 Fixes #5122 Fixes #6192

@ToobLac ToobLac marked this pull request as ready for review June 19, 2026 03:50
@Glavo

Glavo commented Jun 21, 2026

Copy link
Copy Markdown
Member

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for a custom overlay pane in JFXDialog, allowing dialogs to be rendered on a separate overlay container. The feedback highlights critical areas for improvement, including adding null checks to the overlayPaneProperty listener to prevent NullPointerExceptions, ensuring that the dialog content and overlay pane are properly made visible when showing a dialog without animations, and defaulting the overlay pane to the dialog itself if set to null to avoid errors elsewhere in the class.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread HMCL/src/main/java/com/jfoenix/controls/JFXDialog.java
Comment thread HMCL/src/main/java/com/jfoenix/controls/JFXDialog.java
Comment thread HMCL/src/main/java/com/jfoenix/controls/JFXDialog.java
ToobLac and others added 3 commits June 21, 2026 15:21
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@Glavo

Glavo commented Jun 25, 2026

Copy link
Copy Markdown
Member

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for a custom overlay pane in JFXDialog. It adds a new constructor accepting an overlayPane and updates visibility, opacity, and transition animations to target the contentHolder and the custom overlayPane instead of the dialog itself. Decorator and DecoratorSkin are updated to manage this overlay pane, and DialogUtils is adjusted to pass it during dialog creation. Feedback on these changes suggests adding defensive null checks in the overlayPaneProperty listener of JFXDialog to prevent potential NullPointerExceptions, and directly utilizing the new 5-parameter constructor in DialogUtils to avoid redundant layout configurations.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread HMCL/src/main/java/com/jfoenix/controls/JFXDialog.java
Comment thread HMCL/src/main/java/org/jackhuang/hmcl/ui/DialogUtils.java Outdated
@ToobLac ToobLac marked this pull request as draft June 25, 2026 14:53
@ToobLac ToobLac marked this pull request as ready for review June 26, 2026 05:49
@Minecraft269

Copy link
Copy Markdown

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for custom overlay panes in JFXDialog by adding an overlayPane property and updating the dialog display and animation logic to target the overlay pane and content holder separately. It also updates DialogUtils and Decorator to support this new overlay pane. The review feedback suggests removing commented-out dead code in JFXDialog.java and restoring a removed show method overload in DialogUtils.java to prevent breaking backward compatibility.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +162 to 163
//this.setVisible(false);
this.getStyleClass().add(DEFAULT_STYLE_CLASS);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

建议删除被注释掉的死代码 //this.setVisible(false);,以保持代码库的整洁和可维护性。

Suggested change
//this.setVisible(false);
this.getStyleClass().add(DEFAULT_STYLE_CLASS);
this.getStyleClass().add(DEFAULT_STYLE_CLASS);

Comment on lines 65 to 67
public static void show(StackPane container, Node content) {
show(container, content, null);
show(container, content, null, null);
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

在此处删除了原有的 show(StackPane container, Node content, @Nullable Consumer<JFXDialog> onDialogCreated) 方法,这可能会导致代码库中其他调用该方法的地方出现编译错误。建议保留该方法作为重载,以确保向后兼容性。

    public static void show(StackPane container, Node content) {
        show(container, content, null, null);
    }

    public static void show(StackPane container, Node content, @Nullable Consumer<JFXDialog> onDialogCreated) {
        show(container, content, null, onDialogCreated);
    }

@Minecraft269

Copy link
Copy Markdown

CC @Glavo can merge

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

Labels

None yet

Projects

None yet

4 participants