FIx: too large spinner in accountlistitem. Closes #999.

This commit is contained in:
huanghongxun 2021-09-04 15:52:40 +08:00
parent 723f216e6b
commit c11d947099
2 changed files with 5 additions and 1 deletions

View File

@ -90,6 +90,7 @@ public class AccountListItemSkin extends SkinBase<AccountListItem> {
JFXButton btnRefresh = new JFXButton(); JFXButton btnRefresh = new JFXButton();
SpinnerPane spinnerRefresh = new SpinnerPane(); SpinnerPane spinnerRefresh = new SpinnerPane();
spinnerRefresh.getStyleClass().setAll("small-spinner-pane");
btnRefresh.setOnMouseClicked(e -> { btnRefresh.setOnMouseClicked(e -> {
spinnerRefresh.showSpinner(); spinnerRefresh.showSpinner();
skinnable.refreshAsync() skinnable.refreshAsync()

View File

@ -36,6 +36,10 @@ public class SpinnerPane extends Control {
private final BooleanProperty loading = new SimpleBooleanProperty(this, "loading"); private final BooleanProperty loading = new SimpleBooleanProperty(this, "loading");
private final StringProperty failedReason = new SimpleStringProperty(this, "failedReason"); private final StringProperty failedReason = new SimpleStringProperty(this, "failedReason");
public SpinnerPane() {
getStyleClass().add("spinner-pane");
}
public void showSpinner() { public void showSpinner() {
setLoading(true); setLoading(true);
} }
@ -99,7 +103,6 @@ public class SpinnerPane extends Control {
protected Skin(SpinnerPane control) { protected Skin(SpinnerPane control) {
super(control); super(control);
root.getStyleClass().add("spinner-pane");
topPane.getChildren().setAll(spinner); topPane.getChildren().setAll(spinner);
topPane.getStyleClass().add("notice-pane"); topPane.getStyleClass().add("notice-pane");
failedPane.getChildren().setAll(failedReasonLabel); failedPane.getChildren().setAll(failedReasonLabel);