From c11d947099a481c4404def4842aac99b4b75e1f6 Mon Sep 17 00:00:00 2001 From: huanghongxun Date: Sat, 4 Sep 2021 15:52:40 +0800 Subject: [PATCH] FIx: too large spinner in accountlistitem. Closes #999. --- .../org/jackhuang/hmcl/ui/account/AccountListItemSkin.java | 1 + .../java/org/jackhuang/hmcl/ui/construct/SpinnerPane.java | 5 ++++- 2 files 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 9a4af5470..b84d29583 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 @@ -90,6 +90,7 @@ public class AccountListItemSkin extends SkinBase { JFXButton btnRefresh = new JFXButton(); SpinnerPane spinnerRefresh = new SpinnerPane(); + spinnerRefresh.getStyleClass().setAll("small-spinner-pane"); btnRefresh.setOnMouseClicked(e -> { spinnerRefresh.showSpinner(); skinnable.refreshAsync() diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/SpinnerPane.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/SpinnerPane.java index 68671de95..0d2dd38b9 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/SpinnerPane.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/SpinnerPane.java @@ -36,6 +36,10 @@ public class SpinnerPane extends Control { private final BooleanProperty loading = new SimpleBooleanProperty(this, "loading"); private final StringProperty failedReason = new SimpleStringProperty(this, "failedReason"); + public SpinnerPane() { + getStyleClass().add("spinner-pane"); + } + public void showSpinner() { setLoading(true); } @@ -99,7 +103,6 @@ public class SpinnerPane extends Control { protected Skin(SpinnerPane control) { super(control); - root.getStyleClass().add("spinner-pane"); topPane.getChildren().setAll(spinner); topPane.getStyleClass().add("notice-pane"); failedPane.getChildren().setAll(failedReasonLabel);