Skip to content

Commit

Permalink
Merge pull request #5090 from jmacxx/disable_cpu_intensive_animations
Browse files Browse the repository at this point in the history
Disable CPU-intensive animations
  • Loading branch information
ripcurlx authored Jan 19, 2021
2 parents 3d9e2a5 + daf5106 commit 071e1e5
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 26 deletions.
24 changes: 13 additions & 11 deletions desktop/src/main/java/bisq/desktop/main/MainView.java
Original file line number Diff line number Diff line change
Expand Up @@ -688,10 +688,11 @@ private AnchorPane createFooter() {
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) {
Expand All @@ -708,12 +709,13 @@ private AnchorPane createFooter() {
}
});

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();
Expand All @@ -737,7 +739,7 @@ private AnchorPane createFooter() {
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);
Expand Down
24 changes: 14 additions & 10 deletions desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,9 @@ protected void doActivate() {
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());
Expand Down Expand Up @@ -275,8 +276,9 @@ protected void deactivate() {
removeListeners();
removeSubscriptions();

if (waitingForFundsSpinner != null)
waitingForFundsSpinner.stop();
// temporarily disabled due to high CPU usage (per issue #4649)
//if (waitingForFundsSpinner != null)
// waitingForFundsSpinner.stop();
}
}

Expand Down Expand Up @@ -436,7 +438,8 @@ private void onShowPayFundsScreen() {
.show();
}

waitingForFundsSpinner.play();
// temporarily disabled due to high CPU usage (per issue #4649)
// waitingForFundsSpinner.play();

payFundsTitledGroupBg.setVisible(true);
totalToPayTextField.setVisible(true);
Expand Down Expand Up @@ -654,11 +657,12 @@ private void removeBindings() {
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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,8 @@ protected void activate() {
addListeners();

if (offerAvailabilityBusyAnimation != null && !model.showPayFundsScreenDisplayed.get()) {
offerAvailabilityBusyAnimation.play();
// temporarily disabled due to high CPU usage (per issue #4649)
// offerAvailabilityBusyAnimation.play();
offerAvailabilityLabel.setVisible(true);
offerAvailabilityLabel.setManaged(true);
} else {
Expand All @@ -272,7 +273,8 @@ protected void activate() {
}

if (waitingForFundsBusyAnimation != null && model.isWaitingForFunds.get()) {
waitingForFundsBusyAnimation.play();
// temporarily disabled due to high CPU usage (per issue #4649)
// waitingForFundsBusyAnimation.play();
waitingForFundsLabel.setVisible(true);
waitingForFundsLabel.setManaged(true);
} else {
Expand Down Expand Up @@ -528,7 +530,8 @@ private void onShowPayFundsScreen() {

cancelButton2.setVisible(true);

waitingForFundsBusyAnimation.play();
// temporarily disabled due to high CPU usage (per issue #4649)
//waitingForFundsBusyAnimation.play();

payFundsTitledGroupBg.setVisible(true);
totalToPayTextField.setVisible(true);
Expand Down Expand Up @@ -704,7 +707,8 @@ private void addSubscriptions() {
});

isWaitingForFundsSubscription = EasyBind.subscribe(model.isWaitingForFunds, isWaitingForFunds -> {
waitingForFundsBusyAnimation.play();
// temporarily disabled due to high CPU usage (per issue #4649)
// waitingForFundsBusyAnimation.play();
waitingForFundsLabel.setVisible(isWaitingForFunds);
waitingForFundsLabel.setManaged(isWaitingForFunds);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,8 @@ private void addConfirmAndCancelButtons(boolean isPlaceOffer) {
if (GUIUtil.canCreateOrTakeOfferOrShowPopup(user, navigation)) {
button.setDisable(true);
cancelButton.setDisable(true);
busyAnimation.play();
// temporarily disabled due to high CPU usage (per issue #4649)
// busyAnimation.play();
if (isPlaceOffer) {
spinnerInfoLabel.setText(Res.get("createOffer.fundsBox.placeOfferSpinnerInfo"));
placeOfferHandlerOptional.ifPresent(Runnable::run);
Expand Down

0 comments on commit 071e1e5

Please sign in to comment.