From 433082d8c8196c8d30ad87be09c7d6795220d778 Mon Sep 17 00:00:00 2001 From: KSSJW <165921128+KSSJW@users.noreply.github.com> Date: Sat, 4 Jul 2026 16:30:50 +0800 Subject: [PATCH 1/5] Feat: Added rippler for AccountListItemSkin --- .../hmcl/ui/account/AccountListItemSkin.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java index b42282760da..58cc19b0e2a 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java @@ -19,7 +19,6 @@ import com.jfoenix.controls.JFXButton; import com.jfoenix.controls.JFXRadioButton; -import com.jfoenix.effects.JFXDepthManager; import javafx.beans.binding.Bindings; import javafx.geometry.Pos; import javafx.scene.Cursor; @@ -29,6 +28,7 @@ import javafx.scene.control.Tooltip; import javafx.scene.layout.BorderPane; import javafx.scene.layout.HBox; +import javafx.scene.layout.Region; import javafx.scene.layout.VBox; import org.jackhuang.hmcl.auth.Account; import org.jackhuang.hmcl.auth.authlibinjector.AuthlibInjectorAccount; @@ -41,6 +41,7 @@ import org.jackhuang.hmcl.ui.Controllers; import org.jackhuang.hmcl.ui.FXUtils; import org.jackhuang.hmcl.ui.SVG; +import org.jackhuang.hmcl.ui.construct.RipplerContainer; import org.jackhuang.hmcl.ui.construct.SpinnerPane; import org.jackhuang.hmcl.util.javafx.BindingMapping; @@ -52,8 +53,6 @@ public AccountListItemSkin(AccountListItem skinnable) { super(skinnable); BorderPane root = new BorderPane(); - root.setCursor(Cursor.HAND); - FXUtils.onClicked(root, skinnable::fire); JFXRadioButton chkSelected = new JFXRadioButton(); chkSelected.setMouseTransparent(true); @@ -64,6 +63,7 @@ public AccountListItemSkin(AccountListItem skinnable) { HBox center = new HBox(); center.setSpacing(8); center.setAlignment(Pos.CENTER_LEFT); + center.setMouseTransparent(true); Canvas canvas = new Canvas(32, 32); TexturesLoader.bindAvatar(canvas, skinnable.getAccount()); @@ -171,11 +171,16 @@ public AccountListItemSkin(AccountListItem skinnable) { right.getChildren().add(btnRemove); root.setRight(right); - root.getStyleClass().add("card"); root.setStyle("-fx-padding: 8 8 8 0;"); - JFXDepthManager.setDepth(root, 1); - getChildren().setAll(root); + RipplerContainer rootRippler = new RipplerContainer(root); + rootRippler.setCursor(Cursor.HAND); + FXUtils.onClicked(rootRippler, skinnable::fire); + + Region background = new Region(); + background.setStyle("-fx-background-color: -monet-surface-container-low-transparent-80; -fx-background-radius: 4;"); + + getChildren().setAll(background, rootRippler); } /// Moves the account between local and user account files. From 246b29b147037eaaf076697e0f3fbcff74a7a370 Mon Sep 17 00:00:00 2001 From: KSSJW <165921128+KSSJW@users.noreply.github.com> Date: Sat, 4 Jul 2026 16:38:50 +0800 Subject: [PATCH 2/5] Refactor: PickOnBounds --- .../java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java | 1 + 1 file changed, 1 insertion(+) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java index 58cc19b0e2a..b32f542fe1c 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java @@ -174,6 +174,7 @@ public AccountListItemSkin(AccountListItem skinnable) { root.setStyle("-fx-padding: 8 8 8 0;"); RipplerContainer rootRippler = new RipplerContainer(root); + rootRippler.setPickOnBounds(true); rootRippler.setCursor(Cursor.HAND); FXUtils.onClicked(rootRippler, skinnable::fire); From eed477aafb5c0b4b5521f4c383e801722cd6ee74 Mon Sep 17 00:00:00 2001 From: KSSJW <165921128+KSSJW@users.noreply.github.com> Date: Sat, 4 Jul 2026 16:46:51 +0800 Subject: [PATCH 3/5] Fix: Tooltip, background --- .../org/jackhuang/hmcl/ui/account/AccountListItemSkin.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java index b32f542fe1c..832cd19d041 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java @@ -19,6 +19,8 @@ import com.jfoenix.controls.JFXButton; import com.jfoenix.controls.JFXRadioButton; +import com.jfoenix.effects.JFXDepthManager; + import javafx.beans.binding.Bindings; import javafx.geometry.Pos; import javafx.scene.Cursor; @@ -78,7 +80,7 @@ public AccountListItemSkin(AccountListItem skinnable) { Tooltip tooltip = new Tooltip(); AuthlibInjectorServer server = ((AuthlibInjectorAccount) skinnable.getAccount()).getServer(); tooltip.textProperty().bind(BindingMapping.of(server, AuthlibInjectorServer::toString)); - FXUtils.installSlowTooltip(subtitle, tooltip); + FXUtils.installSlowTooltip(root, tooltip); } VBox item = new VBox(title, subtitle); item.getStyleClass().add("two-line-list-item"); @@ -179,7 +181,9 @@ public AccountListItemSkin(AccountListItem skinnable) { FXUtils.onClicked(rootRippler, skinnable::fire); Region background = new Region(); + background.setMouseTransparent(true); background.setStyle("-fx-background-color: -monet-surface-container-low-transparent-80; -fx-background-radius: 4;"); + JFXDepthManager.setDepth(background, 1); getChildren().setAll(background, rootRippler); } From 5f20c14538f771ee7907e0000ed64faeec504d37 Mon Sep 17 00:00:00 2001 From: KSSJW <165921128+KSSJW@users.noreply.github.com> Date: Sat, 4 Jul 2026 16:55:08 +0800 Subject: [PATCH 4/5] Fix: Tooltip --- .../hmcl/ui/account/AccountListItemSkin.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java index 832cd19d041..9027d87c3d0 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java @@ -55,6 +55,11 @@ public AccountListItemSkin(AccountListItem skinnable) { super(skinnable); BorderPane root = new BorderPane(); + RipplerContainer rootRippler = new RipplerContainer(root); + + rootRippler.setPickOnBounds(true); + rootRippler.setCursor(Cursor.HAND); + FXUtils.onClicked(rootRippler, skinnable::fire); JFXRadioButton chkSelected = new JFXRadioButton(); chkSelected.setMouseTransparent(true); @@ -80,7 +85,7 @@ public AccountListItemSkin(AccountListItem skinnable) { Tooltip tooltip = new Tooltip(); AuthlibInjectorServer server = ((AuthlibInjectorAccount) skinnable.getAccount()).getServer(); tooltip.textProperty().bind(BindingMapping.of(server, AuthlibInjectorServer::toString)); - FXUtils.installSlowTooltip(root, tooltip); + FXUtils.installSlowTooltip(rootRippler, tooltip); } VBox item = new VBox(title, subtitle); item.getStyleClass().add("two-line-list-item"); @@ -175,11 +180,6 @@ public AccountListItemSkin(AccountListItem skinnable) { root.setStyle("-fx-padding: 8 8 8 0;"); - RipplerContainer rootRippler = new RipplerContainer(root); - rootRippler.setPickOnBounds(true); - rootRippler.setCursor(Cursor.HAND); - FXUtils.onClicked(rootRippler, skinnable::fire); - Region background = new Region(); background.setMouseTransparent(true); background.setStyle("-fx-background-color: -monet-surface-container-low-transparent-80; -fx-background-radius: 4;"); From 76569a9557e66789c51a9a22f3b6d6a6eab9c715 Mon Sep 17 00:00:00 2001 From: KSSJW <165921128+KSSJW@users.noreply.github.com> Date: Sat, 4 Jul 2026 17:05:42 +0800 Subject: [PATCH 5/5] Fix: OverflowHidden for rippler --- .../java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java | 1 + 1 file changed, 1 insertion(+) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java index 9027d87c3d0..74a861f0fb7 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/account/AccountListItemSkin.java @@ -59,6 +59,7 @@ public AccountListItemSkin(AccountListItem skinnable) { rootRippler.setPickOnBounds(true); rootRippler.setCursor(Cursor.HAND); + FXUtils.setOverflowHidden(rootRippler, 8); FXUtils.onClicked(rootRippler, skinnable::fire); JFXRadioButton chkSelected = new JFXRadioButton();