From dfa679c35fb2ce09424b809867dd607ae77f49de Mon Sep 17 00:00:00 2001 From: axpoems <145597137+axpoems@users.noreply.github.com> Date: Sat, 9 Nov 2024 19:41:57 +0100 Subject: [PATCH] Only show copy buttons if data is available --- .../trade_details/TradeDetailsView.java | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/open_trades/trade_details/TradeDetailsView.java b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/open_trades/trade_details/TradeDetailsView.java index 1e69b077a4..fa94183a2c 100644 --- a/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/open_trades/trade_details/TradeDetailsView.java +++ b/apps/desktop/desktop/src/main/java/bisq/desktop/main/content/bisq_easy/open_trades/trade_details/TradeDetailsView.java @@ -157,14 +157,12 @@ public TradeDetailsView(TradeDetailsModel model, TradeDetailsController controll // BTC payment address btcPaymentAddressTitleLabel = new Label(); btcPaymentAddressDetailsLabel = new Label(); - btcPaymentAddressDetailsLabel.getStyleClass().addAll("normal-text"); btcPaymentAddressCopyButton = new BisqMenuItem("copy-grey", "copy-white"); HBox btcPaymentAddressBox = createAndGetTitleAndDetailsBox(btcPaymentAddressTitleLabel, btcPaymentAddressDetailsLabel, Optional.of(btcPaymentAddressCopyButton)); // Payment account data paymentAccountDataLabel = new Label(); - paymentAccountDataLabel.getStyleClass().addAll("normal-text"); paymentAccountDataCopyButton = new BisqMenuItem("copy-grey", "copy-white"); paymentAccountDataCopyButton.setTooltip(Res.get("bisqEasy.openTrades.tradeDetails.paymentAccountData.copy")); HBox paymentAccountDataBox = createAndGetTitleAndDetailsBox("bisqEasy.openTrades.tradeDetails.paymentAccountData", @@ -256,21 +254,21 @@ protected void onViewAttached() { assignedMediatorLabel.setText(model.getAssignedMediator()); assignedMediatorBox.setVisible(model.isHasMediatorBeenAssigned()); assignedMediatorBox.setManaged(model.isHasMediatorBeenAssigned()); + btcPaymentAddressCopyButton.setVisible(!model.isBtcPaymentDataEmpty()); + btcPaymentAddressCopyButton.setManaged(!model.isBtcPaymentDataEmpty()); + paymentAccountDataCopyButton.setVisible(!model.isPaymentAccountDataEmpty()); + paymentAccountDataCopyButton.setVisible(!model.isPaymentAccountDataEmpty()); - if (model.isBtcPaymentDataEmpty()) { - btcPaymentAddressDetailsLabel.getStyleClass().remove("text-fill-grey-dimmed"); - btcPaymentAddressDetailsLabel.getStyleClass().remove("text-fill-white"); - btcPaymentAddressDetailsLabel.getStyleClass().add(model.isBtcPaymentDataEmpty() - ? "text-fill-grey-dimmed" - : "text-fill-white"); - } - if (model.isPaymentAccountDataEmpty()) { - paymentAccountDataLabel.getStyleClass().remove("text-fill-grey-dimmed"); - paymentAccountDataLabel.getStyleClass().remove("text-fill-white"); - paymentAccountDataLabel.getStyleClass().add(model.isPaymentAccountDataEmpty() - ? "text-fill-grey-dimmed" - : "text-fill-white"); - } + btcPaymentAddressDetailsLabel.getStyleClass().clear(); + btcPaymentAddressDetailsLabel.getStyleClass().add(model.isBtcPaymentDataEmpty() + ? "text-fill-grey-dimmed" + : "text-fill-white"); + btcPaymentAddressDetailsLabel.getStyleClass().add("normal-text"); + paymentAccountDataLabel.getStyleClass().clear(); + paymentAccountDataLabel.getStyleClass().add(model.isPaymentAccountDataEmpty() + ? "text-fill-grey-dimmed" + : "text-fill-white"); + paymentAccountDataLabel.getStyleClass().add("normal-text"); closeButton.setOnAction(e -> controller.onClose()); tradersAndRoleCopyButton.setOnAction(e -> ClipboardUtil.copyToClipboard(model.getPeer()));