From 3e393982e09ce2b13539fc740af08c3d16b3688b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=9E=E5=BA=90?= <109708109+CiiLu@users.noreply.github.com> Date: Sat, 10 Jan 2026 21:21:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20InstallerItem=20=E7=9A=84?= =?UTF-8?q?=20Rippler=20=E6=B2=A1=E6=9C=89=E6=AD=A3=E5=B8=B8=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98=20(#5184)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Glavo --- .../main/java/org/jackhuang/hmcl/ui/InstallerItem.java | 2 ++ .../jackhuang/hmcl/ui/construct/RipplerContainer.java | 10 +++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/InstallerItem.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/InstallerItem.java index 9c237a7bd..ba14e1f66 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/InstallerItem.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/InstallerItem.java @@ -18,6 +18,7 @@ package org.jackhuang.hmcl.ui; import com.jfoenix.controls.JFXButton; +import com.jfoenix.controls.JFXRippler; import javafx.beans.Observable; import javafx.beans.binding.Bindings; import javafx.beans.property.ObjectProperty; @@ -335,6 +336,7 @@ public class InstallerItem extends Control { } pane.getStyleClass().add("installer-item"); RipplerContainer container = new RipplerContainer(pane); + container.setPosition(JFXRippler.RipplerPos.FRONT); getChildren().setAll(container); pane.pseudoClassStateChanged(LIST_ITEM, control.style == Style.LIST_ITEM); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/RipplerContainer.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/RipplerContainer.java index 806be70ab..90016dc59 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/RipplerContainer.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/RipplerContainer.java @@ -144,12 +144,20 @@ public class RipplerContainer extends StackPane { } protected void updateChildren() { - getChildren().addAll(buttonContainer, getContainer()); + if (buttonRippler.getPosition() == JFXRippler.RipplerPos.BACK) + getChildren().setAll(buttonContainer, getContainer()); + else + getChildren().setAll(getContainer(), buttonContainer); for (int i = 1; i < getChildren().size(); ++i) getChildren().get(i).setPickOnBounds(false); } + public void setPosition(JFXRippler.RipplerPos pos) { + buttonRippler.setPosition(pos); + updateChildren(); + } + public Node getContainer() { return container.get(); }