From 5bf2a78844be1b81d74b1611844de9489dcd82a8 Mon Sep 17 00:00:00 2001 From: jmacxx <47253594+jmacxx@users.noreply.github.com> Date: Tue, 7 Jun 2022 22:08:57 -0500 Subject: [PATCH] Start payment screen reftext message & sizing fixes. --- .../payment/payload/AssetsAccountPayload.java | 3 +++ .../payload/CashByMailAccountPayload.java | 3 +++ .../payment/payload/F2FAccountPayload.java | 3 +++ .../payload/HalCashAccountPayload.java | 3 +++ .../payload/MoneyGramAccountPayload.java | 3 +++ .../payload/PaymentAccountPayload.java | 2 ++ .../payload/WesternUnionAccountPayload.java | 3 +++ .../paymentmethods/CashByMailForm.java | 2 ++ .../components/paymentmethods/F2FForm.java | 1 + .../paymentmethods/GeneralUsBankForm.java | 1 + .../paymentmethods/TransferwiseUsdForm.java | 1 + .../USPostalMoneyOrderForm.java | 1 + .../pendingtrades/PendingTradesView.java | 3 ++- .../steps/buyer/BuyerStep2View.java | 24 +++++++++++++++---- .../main/java/bisq/desktop/util/GUIUtil.java | 5 ++++ 15 files changed, 52 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/bisq/core/payment/payload/AssetsAccountPayload.java b/core/src/main/java/bisq/core/payment/payload/AssetsAccountPayload.java index e35dd4c7bc..3aedcadde5 100644 --- a/core/src/main/java/bisq/core/payment/payload/AssetsAccountPayload.java +++ b/core/src/main/java/bisq/core/payment/payload/AssetsAccountPayload.java @@ -73,6 +73,9 @@ public abstract class AssetsAccountPayload extends PaymentAccountPayload { return getPaymentDetails(); } + @Override + public boolean showRefTextWarning() { return false; } + @Override public byte[] getAgeWitnessInputData() { return super.getAgeWitnessInputData(address.getBytes(StandardCharsets.UTF_8)); diff --git a/core/src/main/java/bisq/core/payment/payload/CashByMailAccountPayload.java b/core/src/main/java/bisq/core/payment/payload/CashByMailAccountPayload.java index f1b906f90d..2971f9d731 100644 --- a/core/src/main/java/bisq/core/payment/payload/CashByMailAccountPayload.java +++ b/core/src/main/java/bisq/core/payment/payload/CashByMailAccountPayload.java @@ -106,6 +106,9 @@ public final class CashByMailAccountPayload extends PaymentAccountPayload implem Res.getWithCol("payment.postal.address") + " " + postalAddress; } + @Override + public boolean showRefTextWarning() { return false; } + @Override public byte[] getAgeWitnessInputData() { // We use here the contact because the address alone seems to be too weak diff --git a/core/src/main/java/bisq/core/payment/payload/F2FAccountPayload.java b/core/src/main/java/bisq/core/payment/payload/F2FAccountPayload.java index ec3246dd50..e1982f143f 100644 --- a/core/src/main/java/bisq/core/payment/payload/F2FAccountPayload.java +++ b/core/src/main/java/bisq/core/payment/payload/F2FAccountPayload.java @@ -118,6 +118,9 @@ public final class F2FAccountPayload extends CountryBasedPaymentAccountPayload { return Res.getWithCol("payment.f2f.contact") + " " + contact; } + @Override + public boolean showRefTextWarning() { return false; } + @Override public byte[] getAgeWitnessInputData() { // We use here the city because the address alone seems to be too weak diff --git a/core/src/main/java/bisq/core/payment/payload/HalCashAccountPayload.java b/core/src/main/java/bisq/core/payment/payload/HalCashAccountPayload.java index c991f0e8a7..e9abccda3c 100644 --- a/core/src/main/java/bisq/core/payment/payload/HalCashAccountPayload.java +++ b/core/src/main/java/bisq/core/payment/payload/HalCashAccountPayload.java @@ -91,6 +91,9 @@ public final class HalCashAccountPayload extends PaymentAccountPayload { return Res.getWithCol("payment.mobile") + " " + mobileNr; } + @Override + public boolean showRefTextWarning() { return false; } + @Override public byte[] getAgeWitnessInputData() { return super.getAgeWitnessInputData(mobileNr.getBytes(StandardCharsets.UTF_8)); diff --git a/core/src/main/java/bisq/core/payment/payload/MoneyGramAccountPayload.java b/core/src/main/java/bisq/core/payment/payload/MoneyGramAccountPayload.java index 03734c68f6..8ecbdb108a 100644 --- a/core/src/main/java/bisq/core/payment/payload/MoneyGramAccountPayload.java +++ b/core/src/main/java/bisq/core/payment/payload/MoneyGramAccountPayload.java @@ -118,6 +118,9 @@ public class MoneyGramAccountPayload extends PaymentAccountPayload implements Pa Res.getWithCol("payment.email") + " " + email; } + @Override + public boolean showRefTextWarning() { return false; } + @Override public byte[] getAgeWitnessInputData() { String all = this.countryCode + diff --git a/core/src/main/java/bisq/core/payment/payload/PaymentAccountPayload.java b/core/src/main/java/bisq/core/payment/payload/PaymentAccountPayload.java index 7fa67beb03..bef7ee466c 100644 --- a/core/src/main/java/bisq/core/payment/payload/PaymentAccountPayload.java +++ b/core/src/main/java/bisq/core/payment/payload/PaymentAccountPayload.java @@ -118,6 +118,8 @@ public abstract class PaymentAccountPayload implements NetworkPayload, UsedForTr public abstract String getPaymentDetailsForTradePopup(); + public boolean showRefTextWarning() { return true; } + public byte[] getSalt() { checkArgument(excludeFromJsonDataMap.containsKey(SALT), "Salt must have been set in excludeFromJsonDataMap."); return Utilities.decodeFromHex(excludeFromJsonDataMap.get(SALT)); diff --git a/core/src/main/java/bisq/core/payment/payload/WesternUnionAccountPayload.java b/core/src/main/java/bisq/core/payment/payload/WesternUnionAccountPayload.java index 45f33186cc..e67fe87ce2 100644 --- a/core/src/main/java/bisq/core/payment/payload/WesternUnionAccountPayload.java +++ b/core/src/main/java/bisq/core/payment/payload/WesternUnionAccountPayload.java @@ -126,6 +126,9 @@ public class WesternUnionAccountPayload extends CountryBasedPaymentAccountPayloa Res.getWithCol("payment.email") + " " + email; } + @Override + public boolean showRefTextWarning() { return false; } + @Override public byte[] getAgeWitnessInputData() { String all = this.countryCode + diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/CashByMailForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/CashByMailForm.java index 5c8b7b50d2..765242a1e4 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/CashByMailForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/CashByMailForm.java @@ -53,11 +53,13 @@ public class CashByMailForm extends PaymentMethodForm { TextArea textAddress = addCompactTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.postal.address"), "").second; textAddress.setMinHeight(70); + textAddress.setMaxHeight(70); textAddress.setEditable(false); textAddress.setText(cbm.getPostalAddress()); TextArea textExtraInfo = addCompactTopLabelTextArea(gridPane, gridRow, 1, Res.get("payment.shared.extraInfo"), "").second; textExtraInfo.setMinHeight(70); + textExtraInfo.setMaxHeight(70); textExtraInfo.setEditable(false); textExtraInfo.setText(cbm.getExtraInfo()); return gridRow; diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/F2FForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/F2FForm.java index 7cd1d3b153..139bc644cf 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/F2FForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/F2FForm.java @@ -63,6 +63,7 @@ public class F2FForm extends PaymentMethodForm { f2fAccountPayload.getContact()); TextArea textArea = addTopLabelTextArea(gridPane, gridRow, 1, Res.get("payment.shared.extraInfo"), "").second; textArea.setMinHeight(70); + textArea.setMaxHeight(70); textArea.setEditable(false); textArea.setId("text-area-disabled"); textArea.setText(offer.getExtraInfo()); diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/GeneralUsBankForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/GeneralUsBankForm.java index cc2d6fedde..e2f94fbd00 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/GeneralUsBankForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/GeneralUsBankForm.java @@ -70,6 +70,7 @@ public abstract class GeneralUsBankForm extends GeneralBankForm { TextArea textAddress = addCompactTopLabelTextArea(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), Res.get("payment.account.address"), "").second; textAddress.setMinHeight(70); + textAddress.setMaxHeight(70); textAddress.setEditable(false); textAddress.setText(holderAddress); } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/TransferwiseUsdForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/TransferwiseUsdForm.java index f0194b2b6e..9bb28e5bb4 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/TransferwiseUsdForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/TransferwiseUsdForm.java @@ -57,6 +57,7 @@ public class TransferwiseUsdForm extends PaymentMethodForm { if (address.length() > 0) { TextArea textAddress = addCompactTopLabelTextArea(gridPane, gridRow, 0, Res.get("payment.account.address"), "").second; textAddress.setMinHeight(70); + textAddress.setMaxHeight(70); textAddress.setEditable(false); textAddress.setText(address); } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/USPostalMoneyOrderForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/USPostalMoneyOrderForm.java index c888975b67..6cd05ee038 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/USPostalMoneyOrderForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/USPostalMoneyOrderForm.java @@ -47,6 +47,7 @@ public class USPostalMoneyOrderForm extends PaymentMethodForm { ((USPostalMoneyOrderAccountPayload) paymentAccountPayload).getHolderName()); TextArea textArea = addCompactTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.postal.address"), "").second; textArea.setMinHeight(70); + textArea.setMaxHeight(70); textArea.setEditable(false); textArea.setId("text-area-disabled"); textArea.setText(((USPostalMoneyOrderAccountPayload) paymentAccountPayload).getPostalAddress()); diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesView.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesView.java index e85c0a948d..3c840869d1 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesView.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesView.java @@ -206,6 +206,7 @@ public class PendingTradesView extends ActivatableViewAndModel o.getTrade().getId())); dateColumn.setComparator(Comparator.comparing(o -> o.getTrade().getDate())); @@ -305,7 +306,7 @@ public class PendingTradesView extends ActivatableViewAndModel tuple3 = addButtonBusyAnimationLabel(gridPane, ++gridRow, 0, Res.get("portfolio.pending.step2_buyer.paymentStarted"), 10); @@ -443,6 +452,11 @@ public class BuyerStep2View extends TradeStepView { busyAnimation = tuple3.second; statusLabel = tuple3.third; + // fix GH issue 6238 - on small res screen, the payment started button cannot be reached + if (GUIUtil.isLimitedScreenHeight()) { + gridPane.setMinHeight(600); // make the scrollpane parent node activate its scrollbar + } + if (trade.getOffer().getCurrencyCode().equals("BSQ")) { fillBsqButton = new AutoTooltipButton(Res.get("portfolio.pending.step2_buyer.fillInBsqWallet")); hBox.getChildren().add(1, fillBsqButton); diff --git a/desktop/src/main/java/bisq/desktop/util/GUIUtil.java b/desktop/src/main/java/bisq/desktop/util/GUIUtil.java index 49d12c83f3..b80e4aa920 100644 --- a/desktop/src/main/java/bisq/desktop/util/GUIUtil.java +++ b/desktop/src/main/java/bisq/desktop/util/GUIUtil.java @@ -97,6 +97,7 @@ import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; import javafx.stage.DirectoryChooser; import javafx.stage.FileChooser; import javafx.stage.Modality; +import javafx.stage.Screen; import javafx.stage.Stage; import javafx.stage.StageStyle; @@ -1257,4 +1258,8 @@ public class GUIUtil { } TOP_ALTCOIN = tradeCurrency; } + + public static boolean isLimitedScreenHeight() { + return Screen.getPrimary().getVisualBounds().getHeight() < 800; + } }