Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
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;
Expand All @@ -29,6 +30,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;
Expand All @@ -41,6 +43,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;

Expand All @@ -52,8 +55,12 @@ public AccountListItemSkin(AccountListItem skinnable) {
super(skinnable);

BorderPane root = new BorderPane();
root.setCursor(Cursor.HAND);
FXUtils.onClicked(root, skinnable::fire);
RipplerContainer rootRippler = new RipplerContainer(root);

rootRippler.setPickOnBounds(true);
rootRippler.setCursor(Cursor.HAND);
FXUtils.setOverflowHidden(rootRippler, 8);
FXUtils.onClicked(rootRippler, skinnable::fire);
Comment thread
KSSJW marked this conversation as resolved.

Comment thread
KSSJW marked this conversation as resolved.
JFXRadioButton chkSelected = new JFXRadioButton();
chkSelected.setMouseTransparent(true);
Expand All @@ -64,6 +71,7 @@ public AccountListItemSkin(AccountListItem skinnable) {
HBox center = new HBox();
center.setSpacing(8);
center.setAlignment(Pos.CENTER_LEFT);
center.setMouseTransparent(true);
Comment thread
KSSJW marked this conversation as resolved.

Canvas canvas = new Canvas(32, 32);
TexturesLoader.bindAvatar(canvas, skinnable.getAccount());
Expand All @@ -78,7 +86,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(rootRippler, tooltip);
}
VBox item = new VBox(title, subtitle);
item.getStyleClass().add("two-line-list-item");
Expand Down Expand Up @@ -171,11 +179,14 @@ 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);
Region background = new Region();
background.setMouseTransparent(true);
background.setStyle("-fx-background-color: -monet-surface-container-low-transparent-80; -fx-background-radius: 4;");
Comment thread
KSSJW marked this conversation as resolved.
JFXDepthManager.setDepth(background, 1);

getChildren().setAll(background, rootRippler);
}

/// Moves the account between local and user account files.
Expand Down