Skip to content

简化 MessageDialogPane#4918

Merged
Glavo merged 2 commits intoHMCL-dev:mainfrom
Glavo:message-dialog-pane
Dec 6, 2025
Merged

简化 MessageDialogPane#4918
Glavo merged 2 commits intoHMCL-dev:mainfrom
Glavo:message-dialog-pane

Conversation

@Glavo
Copy link
Member

@Glavo Glavo commented Dec 4, 2025

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the MessageDialogPane.MessageType enum by moving icon mappings from switch statements into the enum constants themselves, reducing code duplication. The changes eliminate two identical switch statements in MessageDialogPane and HintPane, replacing them with a single getIcon() method on the enum.

Key Changes:

  • Enhanced MessageType enum with icon field and getIcon() method
  • Removed duplicate switch statements from MessageDialogPane and HintPane
  • Removed unnecessary SVG import from HintPane

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
MessageDialogPane.java Added icon field and getIcon() method to MessageType enum, removed switch statement for icon mapping
HintPane.java Removed duplicate switch statement and SVG import, now uses MessageType.getIcon()

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Glavo Glavo merged commit 04b300f into HMCL-dev:main Dec 6, 2025
8 checks passed
@Glavo Glavo deleted the message-dialog-pane branch December 6, 2025 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants