Skip to content

清理 ToggleButton 4 创建#5630

Merged
Glavo merged 4 commits intoHMCL-dev:mainfrom
CiiLu:toggle
Feb 25, 2026
Merged

清理 ToggleButton 4 创建#5630
Glavo merged 4 commits intoHMCL-dev:mainfrom
CiiLu:toggle

Conversation

@CiiLu
Copy link
Contributor

@CiiLu CiiLu commented Feb 23, 2026

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 multiple UI components to standardize “toggle-icon4” icon-button creation by switching from manual JFXButton setup to FXUtils.newToggleButton4(...), and adds a sized overload to support custom icon sizes.

Changes:

  • Replace repeated new JFXButton() + getStyleClass().add("toggle-icon4") + setGraphic(...) with FXUtils.newToggleButton4(SVG[, size]) across various pages/cells/skins.
  • Add FXUtils.newToggleButton4(SVG icon, int size) overload to support explicit icon sizing.
  • Remove now-unneeded per-call boilerplate (style class + graphic assignment) where the helper is used.

Reviewed changes

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

Show a summary per file
File Description
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldListPage.java Use helper for quick-play launch and “more” icon buttons.
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldInfoPage.java Use sized helper for edit/reset icon buttons in world icon controls.
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/WorldBackupsPage.java Use helper for reveal/delete backup action buttons.
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/SchematicsPage.java Use helper for reveal/delete actions in schematic list cell.
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ResourcepackListPage.java Initialize reveal/delete buttons via helper and remove redundant setup.
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPageSkin.java Use helper for restore/info/reveal buttons in mod list cells.
HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListCell.java Use helper for update/test-launch/manage icon buttons.
HMCL/src/main/java/org/jackhuang/hmcl/ui/profile/ProfileListItemSkin.java Use sized helper for the remove/close icon button.
HMCL/src/main/java/org/jackhuang/hmcl/ui/main/SettingsPage.java Use sized helper for update button in settings UI.
HMCL/src/main/java/org/jackhuang/hmcl/ui/main/PersonalizationPage.java Use helper for reset/restore buttons in personalization controls.
HMCL/src/main/java/org/jackhuang/hmcl/ui/main/JavaRestorePage.java Use helper for reveal/remove/restore controls for disabled Java items.
HMCL/src/main/java/org/jackhuang/hmcl/ui/main/JavaManagementPage.java Use helper for reveal button in Java runtime list cell.
HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/ImagePickerItem.java Use sized helper for edit/reset icon buttons.
HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/AdvancedListItem.java Remove direct JFXButton construction/import; create right-action button via helper.
HMCL/src/main/java/org/jackhuang/hmcl/ui/account/CreateAccountPane.java Use sized helper for “add server” icon button.
HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java Use helper for refresh/upload/copy UUID/remove buttons and remove redundant setup.
HMCL/src/main/java/org/jackhuang/hmcl/ui/InstallerItem.java Use helper for the remove/close icon button in installer item UI.
HMCL/src/main/java/org/jackhuang/hmcl/ui/FXUtils.java Add newToggleButton4(SVG, int) overload; keep existing default-size helper.

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

…kin.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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 18 out of 18 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 9dc493d into HMCL-dev:main Feb 25, 2026
6 checks passed
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.

3 participants