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 e35dd4c7bcb..3aedcadde5a 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 String getPaymentDetailsForTradePopup() { 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 f1b906f90de..2971f9d7311 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 String getPaymentDetailsForTradePopup() { 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 ec3246dd50e..e1982f143fb 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 String getPaymentDetailsForTradePopup() { 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 c991f0e8a79..e9abccda3c2 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 String getPaymentDetailsForTradePopup() { 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 03734c68f68..8ecbdb108ab 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 String getPaymentDetailsForTradePopup() { 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 7fa67beb033..bef7ee466c8 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 @@ protected protobuf.PaymentAccountPayload.Builder getPaymentAccountPayloadBuilder 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 45f33186cc3..e67fe87ce27 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 String getPaymentDetailsForTradePopup() { 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 5c8b7b50d2e..765242a1e47 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 static int addFormForBuyer(GridPane gridPane, int gridRow, 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 7cd1d3b153e..139bc644cf7 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 static int addFormForBuyer(GridPane gridPane, int gridRow, 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 cc2d6feddec..e2f94fbd009 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 @@ protected static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAcco 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 f0194b2b6e6..9bb28e5bb4d 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 static int addFormForBuyer(GridPane gridPane, int gridRow, 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 c888975b67f..6cd05ee0388 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 static int addFormForBuyer(GridPane gridPane, int gridRow, ((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 e85c0a948d5..3c840869d19 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 void initialize() { tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); tableView.setPlaceholder(new AutoTooltipLabel(Res.get("table.placeholder.noItems", Res.get("shared.openTrades")))); tableView.setMinHeight(100); + tableView.setMaxHeight(350); tradeIdColumn.setComparator(Comparator.comparing(o -> o.getTrade().getId())); dateColumn.setComparator(Comparator.comparing(o -> o.getTrade().getDate())); @@ -305,7 +306,7 @@ protected void activate() { selectedSubView = model.dataModel.tradeManager.isBuyer(model.dataModel.getOffer()) ? new BuyerSubView(model) : new SellerSubView(model); - selectedSubView.setMinHeight(460); + selectedSubView.setMinHeight(480); VBox.setVgrow(selectedSubView, Priority.ALWAYS); if (root.getChildren().size() == 2) root.getChildren().add(selectedSubView); diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java index 304b2a48a29..dc989525a76 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep2View.java @@ -19,6 +19,7 @@ import bisq.desktop.components.AutoTooltipButton; import bisq.desktop.components.BusyAnimation; +import bisq.desktop.components.SimpleMarkdownLabel; import bisq.desktop.components.TextFieldWithCopyIcon; import bisq.desktop.components.TitledGroupBg; import bisq.desktop.components.paymentmethods.AchTransferForm; @@ -80,6 +81,7 @@ import bisq.desktop.main.overlays.windows.SetXmrTxKeyWindow; import bisq.desktop.main.portfolio.pendingtrades.PendingTradesViewModel; import bisq.desktop.main.portfolio.pendingtrades.steps.TradeStepView; +import bisq.desktop.util.GUIUtil; import bisq.desktop.util.Layout; import bisq.desktop.util.Transitions; @@ -124,10 +126,7 @@ import java.util.List; import java.util.concurrent.TimeUnit; -import static bisq.desktop.util.FormBuilder.addButtonBusyAnimationLabel; -import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; -import static bisq.desktop.util.FormBuilder.addTitledGroupBg; -import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; +import static bisq.desktop.util.FormBuilder.*; import static com.google.common.base.Preconditions.checkNotNull; public class BuyerStep2View extends TradeStepView { @@ -239,11 +238,15 @@ protected void addContent() { addTradeInfoBlock(); + int rowSpanStart = gridRow; + PaymentAccountPayload paymentAccountPayload = model.dataModel.getSellersPaymentAccountPayload(); String paymentMethodId = paymentAccountPayload != null ? paymentAccountPayload.getPaymentMethodId() : ""; TitledGroupBg accountTitledGroupBg = addTitledGroupBg(gridPane, ++gridRow, 4, Res.get("portfolio.pending.step2_buyer.startPaymentUsing", Res.get(paymentMethodId)), Layout.COMPACT_GROUP_DISTANCE); + GridPane.setColumnSpan(accountTitledGroupBg, 2); + TextFieldWithCopyIcon field = addTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 0, Res.get("portfolio.pending.step2_buyer.amountToTransfer"), model.getFiatVolume(), @@ -431,7 +434,13 @@ protected void addContent() { } } - GridPane.setRowSpan(accountTitledGroupBg, gridRow - 1); + if (paymentAccountPayload.showRefTextWarning()) { + SimpleMarkdownLabel footerLabel = addSimpleMarkdownLabel(gridPane, ++gridRow, Res.get("portfolio.pending.step2_buyer.refTextWarn"), 10); + footerLabel.getStyleClass().add("medium-text"); + GridPane.setColumnSpan(footerLabel, 2); + } + + GridPane.setRowSpan(accountTitledGroupBg, gridRow - rowSpanStart); Tuple4 tuple3 = addButtonBusyAnimationLabel(gridPane, ++gridRow, 0, Res.get("portfolio.pending.step2_buyer.paymentStarted"), 10); @@ -443,6 +452,11 @@ protected void addContent() { 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 49d12c83f38..b80e4aa920c 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 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 static void updateTopAltcoin(Preferences preferences) { } TOP_ALTCOIN = tradeCurrency; } + + public static boolean isLimitedScreenHeight() { + return Screen.getPrimary().getVisualBounds().getHeight() < 800; + } }