Disable CPU-intensive animations

Comments out the code for footer bar progress indicator shown when
receiving a DAO block

Comments out the code for the spinner indicator shown when waiting
for trade to be funded

https://github.com/bisq-network/bisq/issues/4649#issuecomment-761950701

Fixes #4649
This commit is contained in:
jmacxx 2021-01-18 13:23:18 -06:00
parent d3971ef7dd
commit feb88bc769
No known key found for this signature in database
GPG key ID: 155297BABFE94A1B
2 changed files with 27 additions and 21 deletions

View file

@ -688,10 +688,11 @@ public class MainView extends InitializableView<StackPane, MainViewModel>
setLeftAnchor(btcInfoLabel, 10d);
setBottomAnchor(btcInfoLabel, 7d);
ProgressBar blockchainSyncIndicator = new JFXProgressBar(-1);
blockchainSyncIndicator.setPrefWidth(80);
blockchainSyncIndicator.setMaxHeight(10);
blockchainSyncIndicator.progressProperty().bind(model.getCombinedSyncProgress());
// temporarily disabled due to high CPU usage (per issue #4649)
//ProgressBar blockchainSyncIndicator = new JFXProgressBar(-1);
//blockchainSyncIndicator.setPrefWidth(80);
//blockchainSyncIndicator.setMaxHeight(10);
//blockchainSyncIndicator.progressProperty().bind(model.getCombinedSyncProgress());
model.getWalletServiceErrorMsg().addListener((ov, oldValue, newValue) -> {
if (newValue != null) {
@ -708,12 +709,13 @@ public class MainView extends InitializableView<StackPane, MainViewModel>
}
});
model.getCombinedSyncProgress().addListener((ov, oldValue, newValue) -> {
if ((double) newValue >= 1) {
blockchainSyncIndicator.setVisible(false);
blockchainSyncIndicator.setManaged(false);
}
});
// temporarily disabled due to high CPU usage (per issue #4649)
//model.getCombinedSyncProgress().addListener((ov, oldValue, newValue) -> {
// if ((double) newValue >= 1) {
// blockchainSyncIndicator.setVisible(false);
// blockchainSyncIndicator.setManaged(false);
// }
//});
// version
Label versionLabel = new AutoTooltipLabel();
@ -737,7 +739,7 @@ public class MainView extends InitializableView<StackPane, MainViewModel>
versionBox.setSpacing(10);
versionBox.setAlignment(Pos.CENTER);
versionBox.setAlignment(Pos.BASELINE_CENTER);
versionBox.getChildren().addAll(versionLabel, blockchainSyncIndicator);
versionBox.getChildren().addAll(versionLabel); //blockchainSyncIndicator removed per issue #4649
setLeftAnchor(versionBox, 10d);
setRightAnchor(versionBox, 10d);
setBottomAnchor(versionBox, 7d);

View file

@ -235,8 +235,9 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> exten
addListeners();
addSubscriptions();
if (waitingForFundsSpinner != null)
waitingForFundsSpinner.play();
// temporarily disabled due to high CPU usage (per issue #4649)
// if (waitingForFundsSpinner != null)
// waitingForFundsSpinner.play();
amountDescriptionLabel.setText(model.getAmountDescription());
addressTextField.setAddress(model.getAddressAsString());
@ -275,8 +276,9 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> exten
removeListeners();
removeSubscriptions();
if (waitingForFundsSpinner != null)
waitingForFundsSpinner.stop();
// temporarily disabled due to high CPU usage (per issue #4649)
//if (waitingForFundsSpinner != null)
// waitingForFundsSpinner.stop();
}
}
@ -436,7 +438,8 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> exten
.show();
}
waitingForFundsSpinner.play();
// temporarily disabled due to high CPU usage (per issue #4649)
// waitingForFundsSpinner.play();
payFundsTitledGroupBg.setVisible(true);
totalToPayTextField.setVisible(true);
@ -654,11 +657,12 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> exten
private void addSubscriptions() {
isWaitingForFundsSubscription = EasyBind.subscribe(model.isWaitingForFunds, isWaitingForFunds -> {
if (isWaitingForFunds) {
waitingForFundsSpinner.play();
} else {
waitingForFundsSpinner.stop();
}
// temporarily disabled due to high CPU usage (per issue #4649)
//if (isWaitingForFunds) {
// waitingForFundsSpinner.play();
//} else {
// waitingForFundsSpinner.stop();
//}
waitingForFundsLabel.setVisible(isWaitingForFunds);
waitingForFundsLabel.setManaged(isWaitingForFunds);