diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index f9ce7516f6..b34ae7a297 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -519,8 +519,8 @@ portfolio.pending.step2_buyer.postal=Please send {0} by \"US Postal Money Order\ portfolio.pending.step2_buyer.bank=Please go to your online banking web page and pay {0} to the BTC seller.\n\n portfolio.pending.step2_buyer.f2f=Please contact the BTC seller by the provided contact and arrange a meeting to pay {0}.\n\n portfolio.pending.step2_buyer.startPaymentUsing=Start payment using {0} -portfolio.pending.step2_buyer.amountToTransfer=Amount to transfer: -portfolio.pending.step2_buyer.sellersAddress=Seller''s {0} address: +portfolio.pending.step2_buyer.amountToTransfer=Amount to transfer +portfolio.pending.step2_buyer.sellersAddress=Seller''s {0} address portfolio.pending.step2_buyer.buyerAccount=Your payment account to be used portfolio.pending.step2_buyer.paymentStarted=Payment started portfolio.pending.step2_buyer.warn=You still have not done your {0} payment!\nPlease note that the trade has to be completed by {1} otherwise the trade will be investigated by the arbitrator. @@ -569,7 +569,7 @@ message.state.FAILED=Sending message failed portfolio.pending.step3_buyer.wait.headline=Wait for BTC seller's payment confirmation portfolio.pending.step3_buyer.wait.info=Waiting for the BTC seller''s confirmation for the receipt of the {0} payment. -portfolio.pending.step3_buyer.wait.msgStateInfo.label=Payment started message status: +portfolio.pending.step3_buyer.wait.msgStateInfo.label=Payment started message status portfolio.pending.step3_buyer.warn.part1a=on the {0} blockchain portfolio.pending.step3_buyer.warn.part1b=at your payment provider (e.g. bank) portfolio.pending.step3_buyer.warn.part2=The BTC seller still has not confirmed your payment!\nPlease check {0} if the payment sending was successful.\nIf the BTC seller does not confirm the receipt of your payment by {1} the trade will be investigated by the arbitrator. @@ -605,11 +605,11 @@ portfolio.pending.step3_seller.bankCheck=\n\nPlease also verify that the sender' If the name is not the same as the one displayed here, {1} portfolio.pending.step3_seller.openDispute=please don't confirm but open a dispute by entering \"alt + o\" or \"option + o\". portfolio.pending.step3_seller.confirmPaymentReceipt=Confirm payment receipt -portfolio.pending.step3_seller.amountToReceive=Amount to receive: -portfolio.pending.step3_seller.yourAddress=Your {0} address: -portfolio.pending.step3_seller.buyersAddress=Buyers {0} address: -portfolio.pending.step3_seller.yourAccount=Your trading account: -portfolio.pending.step3_seller.buyersAccount=Buyers trading account: +portfolio.pending.step3_seller.amountToReceive=Amount to receive +portfolio.pending.step3_seller.yourAddress=Your {0} address +portfolio.pending.step3_seller.buyersAddress=Buyers {0} address +portfolio.pending.step3_seller.yourAccount=Your trading account +portfolio.pending.step3_seller.buyersAccount=Buyers trading account portfolio.pending.step3_seller.confirmReceipt=Confirm payment receipt portfolio.pending.step3_seller.buyerStartedPayment=The BTC buyer has started the {0} payment.\n{1} portfolio.pending.step3_seller.buyerStartedPayment.altcoin=Check for blockchain confirmations at your altcoin wallet or block explorer and confirm the payment when you have sufficient blockchain confirmations. @@ -629,13 +629,13 @@ portfolio.pending.step3_seller.onPaymentReceived.confirm.headline=Confirm that y portfolio.pending.step3_seller.onPaymentReceived.confirm.yes=Yes, I have received the payment portfolio.pending.step5_buyer.groupTitle=Summary of completed trade -portfolio.pending.step5_buyer.tradeFee=Trade fee: -portfolio.pending.step5_buyer.makersMiningFee=Mining fee: -portfolio.pending.step5_buyer.takersMiningFee=Total mining fees: -portfolio.pending.step5_buyer.refunded=Refunded security deposit: +portfolio.pending.step5_buyer.tradeFee=Trade fee +portfolio.pending.step5_buyer.makersMiningFee=Mining fee +portfolio.pending.step5_buyer.takersMiningFee=Total mining fees +portfolio.pending.step5_buyer.refunded=Refunded security deposit portfolio.pending.step5_buyer.withdrawBTC=Withdraw your bitcoin -portfolio.pending.step5_buyer.amount=Amount to withdraw: -portfolio.pending.step5_buyer.withdrawToAddress=Withdraw to address: +portfolio.pending.step5_buyer.amount=Amount to withdraw +portfolio.pending.step5_buyer.withdrawToAddress=Withdraw to address portfolio.pending.step5_buyer.moveToBisqWallet=Move funds to Bisq wallet portfolio.pending.step5_buyer.withdrawExternal=Withdraw to external wallet portfolio.pending.step5_buyer.alreadyWithdrawn=Your funds have already been withdrawn.\nPlease check the transaction history. @@ -643,11 +643,11 @@ portfolio.pending.step5_buyer.confirmWithdrawal=Confirm withdrawal request portfolio.pending.step5_buyer.amountTooLow=The amount to transfer is lower than the transaction fee and the min. possible tx value (dust). portfolio.pending.step5_buyer.withdrawalCompleted.headline=Withdrawal completed portfolio.pending.step5_buyer.withdrawalCompleted.msg=Your completed trades are stored under \"Portfolio/History\".\nYou can review all your bitcoin transactions under \"Funds/Transactions\" -portfolio.pending.step5_buyer.bought=You have bought: -portfolio.pending.step5_buyer.paid=You have paid: +portfolio.pending.step5_buyer.bought=You have bought +portfolio.pending.step5_buyer.paid=You have paid -portfolio.pending.step5_seller.sold=You have sold: -portfolio.pending.step5_seller.received=You have received: +portfolio.pending.step5_seller.sold=You have sold +portfolio.pending.step5_seller.received=You have received tradeFeedbackWindow.title=Congratulations on completing your trade tradeFeedbackWindow.msg.part1=We'd love to hear back from you about your experience. It'll help us to improve the software \ diff --git a/desktop/src/main/java/bisq/desktop/bisq.css b/desktop/src/main/java/bisq/desktop/bisq.css index b9c47edf3a..a4ad0e1352 100644 --- a/desktop/src/main/java/bisq/desktop/bisq.css +++ b/desktop/src/main/java/bisq/desktop/bisq.css @@ -257,6 +257,11 @@ bg color of non edit textFields: fafafa -fx-background-color: -bs-rd-green; } +.jfx-progress-bar.error > .bar, +.jfx-progress-bar:indeterminate.error > .bar { + -fx-background-color: -bs-rd-error-red; +} + .jfx-spinner { -jfx-radius: 10; } @@ -1356,43 +1361,27 @@ textfield */ -fx-background-radius: 3px, 3px, 2px, 1px; } -/* Pending trades */ +/* Pending trayes */ + #trade-wizard-item-background-disabled { - -fx-text-fill: -bs-grey; - -fx-body-color: linear-gradient(to bottom, -bs-content-bg-grey, -bs-very-light-grey); - -fx-outer-border: linear-gradient(to bottom, -bs-bg-grey, -bs-light-grey); - /* -fx-body-color: -bs-very-light-grey; - -fx-outer-border: -bs-light-grey;*/ - -fx-background-color: -fx-shadow-highlight-color, - -fx-outer-border, - -fx-inner-border, - -fx-body-color; - -fx-background-insets: 0 0 -1 0, 0, 1, 2; - -fx-background-radius: 1px, 1px, 1px, 1px; + -fx-text-fill: -bs-rd-font-light; } #trade-wizard-item-background-active { - -fx-font-weight: bold; - -fx-font-size: 1.077em; - -fx-body-color: linear-gradient(to bottom, -bs-bg-grey5, -bs-bg-grey6); - -fx-outer-border: linear-gradient(to bottom, -bs-bg-blue1, -bs-bg-blue2); - -fx-background-color: -fx-shadow-highlight-color, - -fx-outer-border, - -fx-inner-border, - -fx-body-color; - -fx-background-insets: 0 0 -1 0, 0, 1, 2; - -fx-background-radius: 1px, 1px, 1px, 1px; + -fx-text-fill: -bs-rd-black; + -fx-font-family: "IBM Plex Sans Medium"; } -#trade-wizard-item-background-completed { - -fx-body-color: linear-gradient(to bottom, -bs-content-bg-grey, -bs-bg-grey8); - -fx-outer-border: linear-gradient(to bottom, -bs-bg-green, -bs-bg-green2); - -fx-background-color: -fx-shadow-highlight-color, - -fx-outer-border, - -fx-inner-border, - -fx-body-color; - -fx-background-insets: 0 0 -1 0, 0, 1, 2; - -fx-background-radius: 1px, 1px, 1px, 1px; +.trade-step-label { + -fx-text-fill: -bs-rd-white; +} + +.trade-step-disabled-bg { + -fx-fill: -bs-rd-grey-background-darker-2; +} + +.trade-step-active-bg { + -fx-fill: -bs-rd-green-dark; } #open-support-button { @@ -1403,6 +1392,7 @@ textfield */ #open-dispute-button { -fx-font-weight: bold; + -fx-text-fill: -bs-rd-white; -fx-font-size: 1.077em; -fx-background-color: -bs-rd-error-red; } diff --git a/desktop/src/main/java/bisq/desktop/components/BusyAnimation.java b/desktop/src/main/java/bisq/desktop/components/BusyAnimation.java index be40232420..d682603e2a 100644 --- a/desktop/src/main/java/bisq/desktop/components/BusyAnimation.java +++ b/desktop/src/main/java/bisq/desktop/components/BusyAnimation.java @@ -17,20 +17,13 @@ package bisq.desktop.components; -import bisq.common.Timer; -import bisq.common.UserThread; - -import javafx.scene.image.ImageView; +import com.jfoenix.controls.JFXSpinner; import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; -import java.util.concurrent.TimeUnit; +public class BusyAnimation extends JFXSpinner { -public class BusyAnimation extends ImageView { - - private Timer timer; - private int rotation; private final BooleanProperty isRunningProperty = new SimpleBooleanProperty(); public BusyAnimation() { @@ -40,41 +33,18 @@ public class BusyAnimation extends ImageView { public BusyAnimation(boolean isRunning) { isRunningProperty.set(isRunning); - setMouseTransparent(true); - setId("spinner"); - - sceneProperty().addListener((obs, oldVal, newVal) -> { - if (newVal == null) - stop(); - else if (isRunning()) - play(); - }); - isRunningProperty.addListener((obs, oldVal, newVal) -> { - if (newVal) - play(); - else - stop(); - }); - updateVisibility(); } public void play() { isRunningProperty.set(true); - - if (timer != null) - timer.stop(); - timer = UserThread.runPeriodically(this::updateAnimation, 100, TimeUnit.MILLISECONDS); - + setProgress(-1); updateVisibility(); } public void stop() { isRunningProperty.set(false); - if (timer != null) { - timer.stop(); - timer = null; - } + setProgress(0); updateVisibility(); } @@ -86,16 +56,6 @@ public class BusyAnimation extends ImageView { return isRunningProperty; } - public void setIsRunning(boolean isRunning) { - isRunningProperty.set(isRunning); - } - - private void updateAnimation() { - int increment = 36; - rotation += increment; - setRotate(rotation); - } - private void updateVisibility() { setVisible(isRunning()); setManaged(isRunning()); diff --git a/desktop/src/main/java/bisq/desktop/components/SeparatedPhaseBars.java b/desktop/src/main/java/bisq/desktop/components/SeparatedPhaseBars.java index d74283c2ee..38696ab793 100644 --- a/desktop/src/main/java/bisq/desktop/components/SeparatedPhaseBars.java +++ b/desktop/src/main/java/bisq/desktop/components/SeparatedPhaseBars.java @@ -20,6 +20,8 @@ package bisq.desktop.components; import bisq.core.dao.state.period.DaoPhase; import bisq.core.locale.Res; +import com.jfoenix.controls.JFXProgressBar; + import javafx.scene.control.Label; import javafx.scene.control.ProgressBar; import javafx.scene.layout.HBox; @@ -66,7 +68,7 @@ public class SeparatedPhaseBars extends VBox { item.setTitleLabel(titleLabel); titlesBars.getChildren().addAll(titleLabel); - ProgressBar progressBar = new ProgressBar(); + ProgressBar progressBar = new JFXProgressBar(); progressBar.setMinHeight(9); progressBar.setMaxHeight(9); progressBar.progressProperty().bind(item.progressProperty); diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/AliPayForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/AliPayForm.java index 6ae3aba993..3b565c8165 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/AliPayForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/AliPayForm.java @@ -30,14 +30,14 @@ import bisq.core.util.validation.InputValidator; import javafx.scene.layout.GridPane; -import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; public class AliPayForm extends GeneralAccountNumberForm { private final AliPayAccount aliPayAccount; public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.no"), ((AliPayAccountPayload) paymentAccountPayload).getAccountNr()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.no"), ((AliPayAccountPayload) paymentAccountPayload).getAccountNr()); return gridRow; } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/BankForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/BankForm.java index 519b458a4b..5b9235b0c1 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/BankForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/BankForm.java @@ -55,17 +55,19 @@ abstract class BankForm extends GeneralBankForm { BankAccountPayload data = (BankAccountPayload) paymentAccountPayload; String countryCode = ((BankAccountPayload) paymentAccountPayload).getCountryCode(); + int colIndex = 0; + if (data.getHolderTaxId() != null) { final String title = Res.get("payment.account.owner") + " / " + BankUtil.getHolderIdLabelShort(countryCode); final String value = data.getHolderName() + " / " + data.getHolderTaxId(); - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, title, value); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), title, value); } else { final String title = Res.get("payment.account.owner"); final String value = data.getHolderName(); - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, title, value); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), title, value); } - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.bank.country"), + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), Res.get("payment.bank.country"), CountryUtil.getNameAndCode(countryCode)); // We don't want to display more than 6 rows to avoid scrolling, so if we get too many fields we combine them horizontally @@ -101,34 +103,34 @@ abstract class BankForm extends GeneralBankForm { prepareFormLayoutFlags(countryCode, nrRows); if (bankNameBankIdCombined) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), bankNameLabel.substring(0, bankNameLabel.length() - 1) + " / " + bankIdLabel.substring(0, bankIdLabel.length() - 1) + ":", data.getBankName() + " / " + data.getBankId()); } if (bankNameBranchIdCombined) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), bankNameLabel.substring(0, bankNameLabel.length() - 1) + " / " + branchIdLabel.substring(0, branchIdLabel.length() - 1) + ":", data.getBankName() + " / " + data.getBranchId()); } if (!bankNameBankIdCombined && !bankNameBranchIdCombined && BankUtil.isBankNameRequired(countryCode)) - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, bankNameLabel, data.getBankName()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), bankNameLabel, data.getBankName()); if (!bankNameBankIdCombined && !bankNameBranchIdCombined && !branchIdAccountNrCombined && bankIdBranchIdCombined) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), bankIdLabel.substring(0, bankIdLabel.length() - 1) + " / " + branchIdLabel.substring(0, branchIdLabel.length() - 1) + ":", data.getBankId() + " / " + data.getBranchId()); } if (!bankNameBankIdCombined && !bankIdBranchIdCombined && BankUtil.isBankIdRequired(countryCode)) - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, bankIdLabel, data.getBankId()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), bankIdLabel, data.getBankId()); if (!bankNameBranchIdCombined && !bankIdBranchIdCombined && branchIdAccountNrCombined) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), branchIdLabel.substring(0, branchIdLabel.length() - 1) + " / " + accountNrLabel.substring(0, accountNrLabel.length() - 1) + ":", data.getBranchId() + " / " + data.getAccountNr()); @@ -136,23 +138,23 @@ abstract class BankForm extends GeneralBankForm { if (!bankNameBranchIdCombined && !bankIdBranchIdCombined && !branchIdAccountNrCombined && BankUtil.isBranchIdRequired(countryCode)) - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, branchIdLabel, data.getBranchId()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), branchIdLabel, data.getBranchId()); if (!branchIdAccountNrCombined && accountNrAccountTypeCombined) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), accountNrLabel.substring(0, accountNrLabel.length() - 1) + " / " + accountTypeLabel, data.getAccountNr() + " / " + data.getAccountType()); } if (!branchIdAccountNrCombined && !accountNrAccountTypeCombined && !nationalAccountIdAccountNrCombined && BankUtil.isAccountNrRequired(countryCode)) - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, accountNrLabel, data.getAccountNr()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), accountNrLabel, data.getAccountNr()); if (!accountNrAccountTypeCombined && BankUtil.isAccountTypeRequired(countryCode)) - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, accountTypeLabel, data.getAccountType()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), accountTypeLabel, data.getAccountType()); if (!branchIdAccountNrCombined && !accountNrAccountTypeCombined && nationalAccountIdAccountNrCombined) - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), nationalAccountIdLabel.substring(0, nationalAccountIdLabel.length() - 1) + " / " + accountNrLabel.substring(0, accountNrLabel.length() - 1), data.getNationalAccountId() + " / " + data.getAccountNr()); diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/CashAppForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/CashAppForm.java index 46cb6d6c35..a17906ec6e 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/CashAppForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/CashAppForm.java @@ -35,8 +35,8 @@ import bisq.core.util.validation.InputValidator; import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.FormBuilder.addTopLabelTextField; -import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; // Removed due too high chargeback risk @Deprecated @@ -46,7 +46,7 @@ public class CashAppForm extends PaymentMethodForm { private InputTextField accountIdInputTextField; public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.cashApp.cashTag"), ((CashAppAccountPayload) paymentAccountPayload).getCashTag()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.cashApp.cashTag"), ((CashAppAccountPayload) paymentAccountPayload).getCashTag()); return gridRow; } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/CashDepositForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/CashDepositForm.java index 63adc8564c..2adcd0bc59 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/CashDepositForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/CashDepositForm.java @@ -59,16 +59,19 @@ public class CashDepositForm extends GeneralBankForm { String requirements = data.getRequirements(); boolean showRequirements = requirements != null && !requirements.isEmpty(); + int colIndex = 0; + if (data.getHolderTaxId() != null) - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), Res.get("payment.account.name.emailAndHolderId", BankUtil.getHolderIdLabel(countryCode)), data.getHolderName() + " / " + data.getHolderEmail() + " / " + data.getHolderTaxId()); else - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.name.email"), + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), + Res.get("payment.account.name.email"), data.getHolderName() + " / " + data.getHolderEmail()); if (!showRequirements) - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.bank.country"), + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), Res.get("payment.bank.country"), CountryUtil.getNameAndCode(countryCode)); else requirements += "\n" + Res.get("payment.bank.country") + " " + CountryUtil.getNameAndCode(countryCode); @@ -105,62 +108,63 @@ public class CashDepositForm extends GeneralBankForm { prepareFormLayoutFlags(countryCode, nrRows); if (bankNameBankIdCombined) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, - bankNameLabel.substring(0, bankNameLabel.length() - 1) + " / " + - bankIdLabel.substring(0, bankIdLabel.length() - 1) + ":", + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), + bankNameLabel + " / " + + bankIdLabel + ":", data.getBankName() + " / " + data.getBankId()); } if (bankNameBranchIdCombined) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, - bankNameLabel.substring(0, bankNameLabel.length() - 1) + " / " + - branchIdLabel.substring(0, branchIdLabel.length() - 1) + ":", + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), + bankNameLabel + " / " + + branchIdLabel + ":", data.getBankName() + " / " + data.getBranchId()); } if (!bankNameBankIdCombined && !bankNameBranchIdCombined && BankUtil.isBankNameRequired(countryCode)) - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, bankNameLabel, data.getBankName()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), bankNameLabel, data.getBankName()); if (!bankNameBankIdCombined && !bankNameBranchIdCombined && !branchIdAccountNrCombined && bankIdBranchIdCombined) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, - bankIdLabel.substring(0, bankIdLabel.length() - 1) + " / " + - branchIdLabel.substring(0, branchIdLabel.length() - 1) + ":", + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, + bankIdLabel + " / " + + branchIdLabel + ":", data.getBankId() + " / " + data.getBranchId()); } if (!bankNameBankIdCombined && !bankIdBranchIdCombined && BankUtil.isBankIdRequired(countryCode)) - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, bankIdLabel, data.getBankId()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), bankIdLabel, data.getBankId()); if (!bankNameBranchIdCombined && !bankIdBranchIdCombined && branchIdAccountNrCombined) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, - branchIdLabel.substring(0, branchIdLabel.length() - 1) + " / " + - accountNrLabel.substring(0, accountNrLabel.length() - 1) + ":", + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), + branchIdLabel + " / " + + accountNrLabel + ":", data.getBranchId() + " / " + data.getAccountNr()); } if (!bankNameBranchIdCombined && !bankIdBranchIdCombined && !branchIdAccountNrCombined && BankUtil.isBranchIdRequired(countryCode)) - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, branchIdLabel, data.getBranchId()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), branchIdLabel, data.getBranchId()); if (!branchIdAccountNrCombined && accountNrAccountTypeCombined) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, - accountNrLabel.substring(0, accountNrLabel.length() - 1) + " / " + accountTypeLabel, + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, + accountNrLabel + " / " + accountTypeLabel, data.getAccountNr() + " / " + data.getAccountType()); } if (!branchIdAccountNrCombined && !accountNrAccountTypeCombined && !nationalAccountIdAccountNrCombined && BankUtil.isAccountNrRequired(countryCode)) - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, accountNrLabel, data.getAccountNr()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), accountNrLabel, data.getAccountNr()); if (!accountNrAccountTypeCombined && BankUtil.isAccountTypeRequired(countryCode)) - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, accountTypeLabel, data.getAccountType()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), accountTypeLabel, data.getAccountType()); if (!branchIdAccountNrCombined && !accountNrAccountTypeCombined && nationalAccountIdAccountNrCombined) - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, - nationalAccountIdLabel.substring(0, nationalAccountIdLabel.length() - 1) + " / " + - accountNrLabel.substring(0, accountNrLabel.length() - 1), data.getNationalAccountId() + + addCompactTopLabelTextFieldWithCopyIcon(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), + nationalAccountIdLabel + " / " + + accountNrLabel, data.getNationalAccountId() + " / " + data.getAccountNr()); if (showRequirements) { - TextArea textArea = addTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.extras"), "").second; + TextArea textArea = addTopLabelTextArea(gridPane, getIndexOfColumn(colIndex) == 0 ? ++gridRow : gridRow, getIndexOfColumn(colIndex++), + Res.get("payment.extras"), "").second; textArea.setMinHeight(45); textArea.setMaxHeight(45); textArea.setEditable(false); diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/ChaseQuickPayForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/ChaseQuickPayForm.java index fb6da6ef1b..e76eb00f6a 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/ChaseQuickPayForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/ChaseQuickPayForm.java @@ -35,6 +35,9 @@ import bisq.core.util.validation.InputValidator; import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField; +import static bisq.desktop.util.FormBuilder.addTopLabelTextField; + public class ChaseQuickPayForm extends PaymentMethodForm { private final ChaseQuickPayAccount chaseQuickPayAccount; @@ -42,9 +45,9 @@ public class ChaseQuickPayForm extends PaymentMethodForm { private InputTextField mobileNrInputTextField; public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), ((ChaseQuickPayAccountPayload) paymentAccountPayload).getHolderName()); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), ((ChaseQuickPayAccountPayload) paymentAccountPayload).getEmail()); return gridRow; } @@ -77,7 +80,7 @@ public class ChaseQuickPayForm extends PaymentMethodForm { TradeCurrency singleTradeCurrency = chaseQuickPayAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); addAccountNameTextFieldWithAutoFillToggleButton(); } @@ -90,18 +93,18 @@ public class ChaseQuickPayForm extends PaymentMethodForm { @Override public void addFormForDisplayAccount() { gridRowFrom = gridRow; - FormBuilder.addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), + addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), chaseQuickPayAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(chaseQuickPayAccount.getPaymentMethod().getId())); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), + addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), chaseQuickPayAccount.getHolderName()); - TextField field = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), + TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), chaseQuickPayAccount.getEmail()).second; field.setMouseTransparent(false); TradeCurrency singleTradeCurrency = chaseQuickPayAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/ClearXchangeForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/ClearXchangeForm.java index d561346a34..496a5007e2 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/ClearXchangeForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/ClearXchangeForm.java @@ -35,15 +35,17 @@ import bisq.core.util.validation.InputValidator; import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; + public class ClearXchangeForm extends PaymentMethodForm { private final ClearXchangeAccount clearXchangeAccount; private final ClearXchangeValidator clearXchangeValidator; private InputTextField mobileNrInputTextField; public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { - FormBuilder.addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.owner"), + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.owner"), ((ClearXchangeAccountPayload) paymentAccountPayload).getHolderName()); - FormBuilder.addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.email.mobile"), + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.email.mobile"), ((ClearXchangeAccountPayload) paymentAccountPayload).getEmailOrMobileNr()); return gridRow; } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/CryptoCurrencyForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/CryptoCurrencyForm.java index 86d0005a36..cda0931966 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/CryptoCurrencyForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/CryptoCurrencyForm.java @@ -49,8 +49,8 @@ import javafx.util.StringConverter; import java.util.Optional; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.FormBuilder.addTopLabelTextField; -import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.GUIUtil.getComboBoxButtonCell; public class CryptoCurrencyForm extends PaymentMethodForm { @@ -64,7 +64,7 @@ public class CryptoCurrencyForm extends PaymentMethodForm { int gridRow, PaymentAccountPayload paymentAccountPayload, String labelTitle) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, labelTitle, + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, labelTitle, ((CryptoCurrencyAccountPayload) paymentAccountPayload).getAddress()); 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 dc49fbec44..974ccb3ea4 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/F2FForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/F2FForm.java @@ -47,9 +47,9 @@ import javafx.scene.control.ComboBox; import javafx.scene.control.TextArea; import javafx.scene.layout.GridPane; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.FormBuilder.addTopLabelTextArea; import static bisq.desktop.util.FormBuilder.addTopLabelTextField; -import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; public class F2FForm extends PaymentMethodForm { private final F2FAccount f2fAccount; @@ -60,13 +60,13 @@ public class F2FForm extends PaymentMethodForm { public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload, Offer offer, double top) { F2FAccountPayload f2fAccountPayload = (F2FAccountPayload) paymentAccountPayload; - FormBuilder.addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("shared.country"), + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, 0, Res.get("shared.country"), CountryUtil.getNameAndCode(f2fAccountPayload.getCountryCode()), top); - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.f2f.contact"), + addCompactTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, Res.get("payment.f2f.city"), + offer.getF2FCity(), top); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.f2f.contact"), f2fAccountPayload.getContact()); - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.f2f.city"), - offer.getF2FCity()); - TextArea textArea = addTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.f2f.extra"), "").second; + TextArea textArea = addTopLabelTextArea(gridPane, gridRow, 1, Res.get("payment.f2f.extra"), "").second; textArea.setPrefHeight(60); textArea.setEditable(false); textArea.setId("text-area-disabled"); diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/FasterPaymentsForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/FasterPaymentsForm.java index 47f996c564..574bf77238 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/FasterPaymentsForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/FasterPaymentsForm.java @@ -36,6 +36,7 @@ import bisq.core.util.validation.InputValidator; import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField; import static bisq.desktop.util.FormBuilder.addTopLabelTextField; public class FasterPaymentsForm extends PaymentMethodForm { @@ -44,9 +45,9 @@ public class FasterPaymentsForm extends PaymentMethodForm { public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { // do not translate as it is used in english only - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, UK_SORT_CODE, + addCompactTopLabelTextField(gridPane, ++gridRow, UK_SORT_CODE, ((FasterPaymentsAccountPayload) paymentAccountPayload).getSortCode()); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.accountNr"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.accountNr"), ((FasterPaymentsAccountPayload) paymentAccountPayload).getAccountNr()); return gridRow; } @@ -83,7 +84,7 @@ public class FasterPaymentsForm extends PaymentMethodForm { TradeCurrency singleTradeCurrency = fasterPaymentsAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); addAccountNameTextFieldWithAutoFillToggleButton(); @@ -99,16 +100,16 @@ public class FasterPaymentsForm extends PaymentMethodForm { gridRowFrom = gridRow; addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), fasterPaymentsAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(fasterPaymentsAccount.getPaymentMethod().getId())); // do not translate as it is used in english only - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, UK_SORT_CODE, fasterPaymentsAccount.getSortCode()); - TextField field = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.accountNr"), + addTopLabelTextField(gridPane, ++gridRow, UK_SORT_CODE, fasterPaymentsAccount.getSortCode()); + TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.accountNr"), fasterPaymentsAccount.getAccountNr()).second; field.setMouseTransparent(false); TradeCurrency singleTradeCurrency = fasterPaymentsAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/GeneralBankForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/GeneralBankForm.java index 87bd24112a..f12faf1fc7 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/GeneralBankForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/GeneralBankForm.java @@ -42,6 +42,10 @@ public abstract class GeneralBankForm extends PaymentMethodForm { super(paymentAccount, accountAgeWitnessService, inputValidator, gridPane, gridRow, formatter); } + static int getIndexOfColumn(int colIndex) { + return colIndex % 2; + } + static void prepareFormLayoutFlags(String countryCode, int currentNumberOfRows) { int nrRows = currentNumberOfRows; diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/HalCashForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/HalCashForm.java index 4ea779837f..f1bcab1565 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/HalCashForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/HalCashForm.java @@ -35,6 +35,7 @@ import bisq.core.util.validation.InputValidator; import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField; import static bisq.desktop.util.FormBuilder.addTopLabelTextField; public class HalCashForm extends PaymentMethodForm { @@ -44,7 +45,7 @@ public class HalCashForm extends PaymentMethodForm { public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.mobile"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.mobile"), ((HalCashAccountPayload) paymentAccountPayload).getMobileNr()); return gridRow; } @@ -70,7 +71,7 @@ public class HalCashForm extends PaymentMethodForm { TradeCurrency singleTradeCurrency = halCashAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); addAccountNameTextFieldWithAutoFillToggleButton(); } @@ -85,14 +86,14 @@ public class HalCashForm extends PaymentMethodForm { gridRowFrom = gridRow; addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), halCashAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(halCashAccount.getPaymentMethod().getId())); - TextField field = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.mobile"), + TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.mobile"), halCashAccount.getMobileNr()).second; field.setMouseTransparent(false); TradeCurrency singleTradeCurrency = halCashAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/InteracETransferForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/InteracETransferForm.java index 8760ca3513..cae2cf15ce 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/InteracETransferForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/InteracETransferForm.java @@ -34,6 +34,9 @@ import bisq.core.util.validation.InputValidator; import javafx.scene.layout.GridPane; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField; +import static bisq.desktop.util.FormBuilder.addTopLabelTextField; + public class InteracETransferForm extends PaymentMethodForm { private final InteracETransferAccount interacETransferAccount; @@ -42,13 +45,13 @@ public class InteracETransferForm extends PaymentMethodForm { public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), ((InteracETransferAccountPayload) paymentAccountPayload).getHolderName()); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.emailOrMobile"), + addCompactTopLabelTextField(gridPane, gridRow, 1, Res.get("payment.emailOrMobile"), ((InteracETransferAccountPayload) paymentAccountPayload).getEmail()); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.secret"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.secret"), ((InteracETransferAccountPayload) paymentAccountPayload).getQuestion()); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.answer"), + addCompactTopLabelTextField(gridPane, gridRow, 1, Res.get("payment.answer"), ((InteracETransferAccountPayload) paymentAccountPayload).getAnswer()); return gridRow; } @@ -94,7 +97,7 @@ public class InteracETransferForm extends PaymentMethodForm { }); TradeCurrency singleTradeCurrency = interacETransferAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); addAccountNameTextFieldWithAutoFillToggleButton(); @@ -108,21 +111,21 @@ public class InteracETransferForm extends PaymentMethodForm { @Override public void addFormForDisplayAccount() { gridRowFrom = gridRow; - FormBuilder.addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), + addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), interacETransferAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(interacETransferAccount.getPaymentMethod().getId())); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), + addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), interacETransferAccount.getHolderName()); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), + addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), interacETransferAccount.getEmail()).second.setMouseTransparent(false); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.secret"), + addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.secret"), interacETransferAccount.getQuestion()).second.setMouseTransparent(false); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.answer"), + addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.answer"), interacETransferAccount.getAnswer()).second.setMouseTransparent(false); TradeCurrency singleTradeCurrency = interacETransferAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/MoneyBeamForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/MoneyBeamForm.java index c34786b8f2..1c61ee7e3a 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/MoneyBeamForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/MoneyBeamForm.java @@ -35,8 +35,8 @@ import bisq.core.util.validation.InputValidator; import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.FormBuilder.addTopLabelTextField; -import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; public class MoneyBeamForm extends PaymentMethodForm { private final MoneyBeamAccount account; @@ -44,7 +44,7 @@ public class MoneyBeamForm extends PaymentMethodForm { private InputTextField accountIdInputTextField; public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.moneyBeam.accountId"), ((MoneyBeamAccountPayload) paymentAccountPayload).getAccountId()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.moneyBeam.accountId"), ((MoneyBeamAccountPayload) paymentAccountPayload).getAccountId()); return gridRow; } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/MoneyGramForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/MoneyGramForm.java index 41e4390f0e..90898bad1a 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/MoneyGramForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/MoneyGramForm.java @@ -46,9 +46,9 @@ import javafx.scene.layout.GridPane; import lombok.extern.slf4j.Slf4j; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.FormBuilder.addInputTextField; import static bisq.desktop.util.FormBuilder.addTopLabelFlowPane; -import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; @Slf4j public class MoneyGramForm extends PaymentMethodForm { @@ -56,15 +56,16 @@ public class MoneyGramForm extends PaymentMethodForm { public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { final MoneyGramAccountPayload payload = (MoneyGramAccountPayload) paymentAccountPayload; - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.fullName"), + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.fullName"), payload.getHolderName()); - FormBuilder.addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.bank.country"), CountryUtil.getNameAndCode(((MoneyGramAccountPayload) paymentAccountPayload).getCountryCode())); if (BankUtil.isStateRequired(payload.getCountryCode())) - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.state"), + addCompactTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, + Res.get("payment.account.state"), payload.getState()); - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.email"), + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.email"), payload.getEmail()); return gridRow; diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/OKPayForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/OKPayForm.java index b013f45bc8..417713addf 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/OKPayForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/OKPayForm.java @@ -45,9 +45,9 @@ import javafx.geometry.VPos; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.FormBuilder.addLabel; import static bisq.desktop.util.FormBuilder.addTopLabelTextField; -import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; @Deprecated public class OKPayForm extends PaymentMethodForm { @@ -59,7 +59,7 @@ public class OKPayForm extends PaymentMethodForm { public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.wallet"), + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.wallet"), ((OKPayAccountPayload) paymentAccountPayload).getAccountNr()); return gridRow; } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/PaymentMethodForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/PaymentMethodForm.java index c3d89aad2f..0b3e7904db 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/PaymentMethodForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/PaymentMethodForm.java @@ -52,6 +52,7 @@ import javafx.scene.control.ToggleButton; import javafx.scene.control.Tooltip; import javafx.scene.layout.FlowPane; import javafx.scene.layout.GridPane; +import javafx.scene.layout.VBox; import javafx.beans.property.BooleanProperty; import javafx.beans.property.SimpleBooleanProperty; @@ -138,8 +139,10 @@ public abstract class PaymentMethodForm { int gridRow, Offer offer) { long hours = offer.getMaxTradePeriod() / 3600_000; - return addLabelInfoTextfield(gridPane, gridRow, Res.get("payment.maxPeriod"), - getTimeText(hours)).second; + final Tuple3 labelInfoTextFieldVBoxTuple3 = + addTopLabelInfoTextField(gridPane, gridRow, Res.get("payment.maxPeriod"), + getTimeText(hours), -Layout.FLOATING_LABEL_DISTANCE); + return labelInfoTextFieldVBoxTuple3.second; } private static String getTimeText(long hours) { diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/PerfectMoneyForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/PerfectMoneyForm.java index b99a654d9c..dfb799201c 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/PerfectMoneyForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/PerfectMoneyForm.java @@ -33,14 +33,14 @@ import javafx.scene.layout.GridPane; import javafx.collections.FXCollections; -import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; public class PerfectMoneyForm extends GeneralAccountNumberForm { private final PerfectMoneyAccount perfectMoneyAccount; public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.no"), ((PerfectMoneyAccountPayload) paymentAccountPayload).getAccountNr()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.no"), ((PerfectMoneyAccountPayload) paymentAccountPayload).getAccountNr()); return gridRow; } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/PopmoneyForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/PopmoneyForm.java index 193d21f041..b6efa53b59 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/PopmoneyForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/PopmoneyForm.java @@ -35,8 +35,9 @@ import bisq.core.util.validation.InputValidator; import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.FormBuilder.addTopLabelTextField; -import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; public class PopmoneyForm extends PaymentMethodForm { private final PopmoneyAccount account; @@ -44,9 +45,9 @@ public class PopmoneyForm extends PaymentMethodForm { private InputTextField accountIdInputTextField; public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), ((PopmoneyAccountPayload) paymentAccountPayload).getHolderName()); - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.popmoney.accountId"), ((PopmoneyAccountPayload) paymentAccountPayload).getAccountId()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.popmoney.accountId"), ((PopmoneyAccountPayload) paymentAccountPayload).getAccountId()); return gridRow; } @@ -77,7 +78,7 @@ public class PopmoneyForm extends PaymentMethodForm { final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency(); final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); addAccountNameTextFieldWithAutoFillToggleButton(); } @@ -91,14 +92,14 @@ public class PopmoneyForm extends PaymentMethodForm { public void addFormForDisplayAccount() { gridRowFrom = gridRow; addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), account.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(account.getPaymentMethod().getId())); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(account.getPaymentMethod().getId())); + addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), account.getHolderName()); - TextField field = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.popmoney.accountId"), account.getAccountId()).second; + TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.popmoney.accountId"), account.getAccountId()).second; field.setMouseTransparent(false); final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency(); final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/PromptPayForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/PromptPayForm.java index 14aa20b367..7b4ea774c1 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/PromptPayForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/PromptPayForm.java @@ -34,6 +34,7 @@ import bisq.core.util.validation.InputValidator; import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField; import static bisq.desktop.util.FormBuilder.addInputTextField; import static bisq.desktop.util.FormBuilder.addTopLabelTextField; @@ -44,7 +45,7 @@ public class PromptPayForm extends PaymentMethodForm { public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { - addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.promptPay.promptPayId"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.promptPay.promptPayId"), ((PromptPayAccountPayload) paymentAccountPayload).getPromptPayId()); return gridRow; } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/RevolutForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/RevolutForm.java index 921acec08e..1120df416d 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/RevolutForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/RevolutForm.java @@ -36,9 +36,9 @@ import javafx.scene.control.TextField; import javafx.scene.layout.FlowPane; import javafx.scene.layout.GridPane; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.FormBuilder.addTopLabelFlowPane; import static bisq.desktop.util.FormBuilder.addTopLabelTextField; -import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; public class RevolutForm extends PaymentMethodForm { private final RevolutAccount account; @@ -47,7 +47,7 @@ public class RevolutForm extends PaymentMethodForm { public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.revolut.accountId"), + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.revolut.accountId"), ((RevolutAccountPayload) paymentAccountPayload).getAccountId()); return gridRow; } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/SepaForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/SepaForm.java index fd3f681d33..8a99086917 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/SepaForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/SepaForm.java @@ -46,7 +46,7 @@ import javafx.collections.FXCollections; import java.util.List; -import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; public class SepaForm extends GeneralSepaForm { @@ -56,14 +56,14 @@ public class SepaForm extends GeneralSepaForm { final String title = Res.get("payment.account.owner"); final String value = sepaAccountPayload.getHolderName(); - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, title, value); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, title, value); - FormBuilder.addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.bank.country"), CountryUtil.getNameAndCode(sepaAccountPayload.getCountryCode())); // IBAN, BIC will not be translated - FormBuilder.addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, IBAN, sepaAccountPayload.getIban()); - FormBuilder.addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, BIC, sepaAccountPayload.getBic()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, IBAN, sepaAccountPayload.getIban()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, BIC, sepaAccountPayload.getBic()); return gridRow; } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/SepaInstantForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/SepaInstantForm.java index fe77e57971..0c9414f599 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/SepaInstantForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/SepaInstantForm.java @@ -46,7 +46,7 @@ import javafx.collections.FXCollections; import java.util.List; -import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; public class SepaInstantForm extends GeneralSepaForm { @@ -56,14 +56,14 @@ public class SepaInstantForm extends GeneralSepaForm { final String title = Res.get("payment.account.owner"); final String value = sepaInstantAccountPayload.getHolderName(); - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, title, value); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, title, value); - FormBuilder.addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.bank.country"), CountryUtil.getNameAndCode(sepaInstantAccountPayload.getCountryCode())); // IBAN, BIC will not be translated - FormBuilder.addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, IBAN, sepaInstantAccountPayload.getIban()); - FormBuilder.addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, BIC, sepaInstantAccountPayload.getBic()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, IBAN, sepaInstantAccountPayload.getIban()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, BIC, sepaInstantAccountPayload.getBic()); return gridRow; } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/SwishForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/SwishForm.java index cb01146504..7b37984af8 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/SwishForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/SwishForm.java @@ -38,6 +38,7 @@ import javafx.scene.layout.GridPane; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField; import static bisq.desktop.util.FormBuilder.addTopLabelTextField; public class SwishForm extends PaymentMethodForm { @@ -49,9 +50,9 @@ public class SwishForm extends PaymentMethodForm { public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), ((SwishAccountPayload) paymentAccountPayload).getHolderName()); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.mobile"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.mobile"), ((SwishAccountPayload) paymentAccountPayload).getMobileNr()); return gridRow; } @@ -85,7 +86,7 @@ public class SwishForm extends PaymentMethodForm { TradeCurrency singleTradeCurrency = swishAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); addAccountNameTextFieldWithAutoFillToggleButton(); } @@ -100,16 +101,16 @@ public class SwishForm extends PaymentMethodForm { gridRowFrom = gridRow; addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), swishAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(swishAccount.getPaymentMethod().getId())); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), + addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), swishAccount.getHolderName()); - TextField field = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.mobile"), + TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.mobile"), swishAccount.getMobileNr()).second; field.setMouseTransparent(false); TradeCurrency singleTradeCurrency = swishAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); } 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 ed8de8e2a8..41b8a6a60c 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/USPostalMoneyOrderForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/USPostalMoneyOrderForm.java @@ -35,9 +35,9 @@ import bisq.core.util.validation.InputValidator; import javafx.scene.control.TextArea; import javafx.scene.layout.GridPane; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.FormBuilder.addTopLabelTextArea; import static bisq.desktop.util.FormBuilder.addTopLabelTextField; -import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; public class USPostalMoneyOrderForm extends PaymentMethodForm { private final USPostalMoneyOrderAccount usPostalMoneyOrderAccount; @@ -46,7 +46,7 @@ public class USPostalMoneyOrderForm extends PaymentMethodForm { public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.owner"), + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.owner"), ((USPostalMoneyOrderAccountPayload) paymentAccountPayload).getHolderName()); TextArea textArea = addTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.postal.address"), "").second; textArea.setPrefHeight(60); diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/UpholdForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/UpholdForm.java index 1473250577..dac0e35620 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/UpholdForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/UpholdForm.java @@ -36,8 +36,8 @@ import javafx.scene.control.TextField; import javafx.scene.layout.FlowPane; import javafx.scene.layout.GridPane; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.FormBuilder.addTopLabelTextField; -import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; public class UpholdForm extends PaymentMethodForm { private final UpholdAccount upholdAccount; @@ -46,7 +46,7 @@ public class UpholdForm extends PaymentMethodForm { public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.uphold.accountId"), + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.uphold.accountId"), ((UpholdAccountPayload) paymentAccountPayload).getAccountId()); return gridRow; } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/VenmoForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/VenmoForm.java index 7b5fcc2159..b9ddee6472 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/VenmoForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/VenmoForm.java @@ -37,8 +37,8 @@ import org.apache.commons.lang3.StringUtils; import javafx.scene.control.TextField; import javafx.scene.layout.GridPane; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.FormBuilder.addTopLabelTextField; -import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; // Removed due too high chargeback risk @Deprecated @@ -48,9 +48,9 @@ public class VenmoForm extends PaymentMethodForm { private InputTextField accountIdInputTextField; public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), + addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), ((VenmoAccountPayload) paymentAccountPayload).getHolderName()); - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.venmo.venmoUserName"), ((VenmoAccountPayload) paymentAccountPayload).getVenmoUserName()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.venmo.venmoUserName"), ((VenmoAccountPayload) paymentAccountPayload).getVenmoUserName()); return gridRow; } @@ -81,7 +81,7 @@ public class VenmoForm extends PaymentMethodForm { final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency(); final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); addAccountNameTextFieldWithAutoFillToggleButton(); } @@ -100,14 +100,14 @@ public class VenmoForm extends PaymentMethodForm { public void addFormForDisplayAccount() { gridRowFrom = gridRow; addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), account.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(account.getPaymentMethod().getId())); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(account.getPaymentMethod().getId())); + addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), account.getHolderName()); - TextField field = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.venmo.venmoUserName"), account.getVenmoUserName()).second; + TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.venmo.venmoUserName"), account.getVenmoUserName()).second; field.setMouseTransparent(false); final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency(); final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/WeChatPayForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/WeChatPayForm.java index 5a0db878bf..7292f2eeb2 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/WeChatPayForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/WeChatPayForm.java @@ -30,14 +30,14 @@ import bisq.core.util.validation.InputValidator; import javafx.scene.layout.GridPane; -import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; public class WeChatPayForm extends GeneralAccountNumberForm { private final WeChatPayAccount weChatPayAccount; public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.no"), ((WeChatPayAccountPayload) paymentAccountPayload).getAccountNr()); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.no"), ((WeChatPayAccountPayload) paymentAccountPayload).getAccountNr()); return gridRow; } diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/WesternUnionForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/WesternUnionForm.java index c190efca98..5c8f0090d3 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/WesternUnionForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/WesternUnionForm.java @@ -46,21 +46,21 @@ import javafx.scene.layout.GridPane; import lombok.extern.slf4j.Slf4j; -import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; @Slf4j public class WesternUnionForm extends PaymentMethodForm { public static int addFormForBuyer(GridPane gridPane, int gridRow, PaymentAccountPayload paymentAccountPayload) { final WesternUnionAccountPayload payload = (WesternUnionAccountPayload) paymentAccountPayload; - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.fullName"), + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.fullName"), payload.getHolderName()); - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.city"), + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.city"), payload.getCity()); if (BankUtil.isStateRequired(payload.getCountryCode())) - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.state"), + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.state"), payload.getState()); - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.email"), + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.email"), payload.getEmail()); return gridRow; diff --git a/desktop/src/main/java/bisq/desktop/main/MainView.java b/desktop/src/main/java/bisq/desktop/main/MainView.java index eff184e791..9874c405b1 100644 --- a/desktop/src/main/java/bisq/desktop/main/MainView.java +++ b/desktop/src/main/java/bisq/desktop/main/MainView.java @@ -26,6 +26,7 @@ import bisq.desktop.common.view.ViewLoader; import bisq.desktop.components.AutoTooltipButton; import bisq.desktop.components.AutoTooltipLabel; import bisq.desktop.components.AutoTooltipToggleButton; +import bisq.desktop.components.BusyAnimation; import bisq.desktop.main.account.AccountView; import bisq.desktop.main.dao.DaoView; import bisq.desktop.main.disputes.DisputesView; @@ -54,7 +55,6 @@ import javax.inject.Inject; import com.jfoenix.controls.JFXBadge; import com.jfoenix.controls.JFXComboBox; import com.jfoenix.controls.JFXProgressBar; -import com.jfoenix.controls.JFXSpinner; import javafx.scene.control.Button; import javafx.scene.control.ComboBox; @@ -146,7 +146,7 @@ public class MainView extends InitializableView { private ChangeListener splashP2PNetworkErrorMsgListener; private ChangeListener splashP2PNetworkIconIdListener; private ChangeListener splashP2PNetworkVisibleListener; - private JFXSpinner splashP2PNetworkBusyAnimation; + private BusyAnimation splashP2PNetworkBusyAnimation; private Label splashP2PNetworkLabel; private ProgressBar btcSyncIndicator; private Label btcSplashInfo; @@ -507,7 +507,7 @@ public class MainView extends InitializableView { splashP2PNetworkLabel.getStyleClass().add("sub-info"); splashP2PNetworkLabel.textProperty().bind(model.getP2PNetworkInfo()); - splashP2PNetworkBusyAnimation = new JFXSpinner(); + splashP2PNetworkBusyAnimation = new BusyAnimation(false); splashP2PNetworkErrorMsgListener = (ov, oldValue, newValue) -> { if (newValue != null) { @@ -515,10 +515,10 @@ public class MainView extends InitializableView { splashP2PNetworkLabel.getStyleClass().remove("sub-info"); splashP2PNetworkLabel.getStyleClass().add("error-text"); splashP2PNetworkBusyAnimation.setDisable(true); - splashP2PNetworkBusyAnimation.setProgress(0); + splashP2PNetworkBusyAnimation.stop(); } else if (model.getSplashP2PNetworkAnimationVisible().get()) { splashP2PNetworkBusyAnimation.setDisable(false); - splashP2PNetworkBusyAnimation.setProgress(-1.0); + splashP2PNetworkBusyAnimation.play(); } }; model.getP2pNetworkWarnMsg().addListener(splashP2PNetworkErrorMsgListener); @@ -554,7 +554,7 @@ public class MainView extends InitializableView { splashP2PNetworkVisibleListener = (ov, oldValue, newValue) -> { splashP2PNetworkBusyAnimation.setDisable(!newValue); - if (newValue) splashP2PNetworkBusyAnimation.setProgress(-1.0); + if (newValue) splashP2PNetworkBusyAnimation.play(); }; model.getSplashP2PNetworkAnimationVisible().addListener(splashP2PNetworkVisibleListener); diff --git a/desktop/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java b/desktop/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java index e19b7c8c29..6923d46489 100644 --- a/desktop/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java +++ b/desktop/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java @@ -47,6 +47,8 @@ import javax.inject.Inject; import de.jensd.fx.fontawesome.AwesomeIcon; +import com.jfoenix.controls.JFXProgressBar; + import javafx.scene.control.Label; import javafx.scene.control.ProgressBar; import javafx.scene.control.TableCell; @@ -131,7 +133,7 @@ public class BsqTxView extends ActivatableView implements BsqBal addConfidenceColumn(); addTxTypeColumn(); - chainSyncIndicator = new ProgressBar(); + chainSyncIndicator = new JFXProgressBar(); chainSyncIndicator.setPrefWidth(120); if (BisqEnvironment.isDAOActivatedAndBaseCurrencySupportingBsq()) chainSyncIndicator.setProgress(-1); diff --git a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java index 8ac64506f1..6c011f13c7 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java @@ -24,6 +24,7 @@ import bisq.desktop.components.AutoTooltipButton; import bisq.desktop.components.AutoTooltipLabel; import bisq.desktop.components.AutoTooltipSlideToggleButton; import bisq.desktop.components.BalanceTextField; +import bisq.desktop.components.BusyAnimation; import bisq.desktop.components.FundsTextField; import bisq.desktop.components.InfoInputTextField; import bisq.desktop.components.InputTextField; @@ -71,8 +72,6 @@ import net.glxn.qrgen.image.ImageType; import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; -import com.jfoenix.controls.JFXSpinner; - import javafx.scene.Node; import javafx.scene.control.Button; import javafx.scene.control.ComboBox; @@ -133,7 +132,7 @@ public abstract class MutableOfferView extends private ScrollPane scrollPane; protected GridPane gridPane; private TitledGroupBg payFundsTitledGroupBg, setDepositTitledGroupBg, paymentTitledGroupBg; - private JFXSpinner waitingForFundsSpinner; + private BusyAnimation waitingForFundsSpinner; private AutoTooltipButton nextButton, cancelButton1, cancelButton2, placeOfferButton; private Button priceTypeToggleButton; private InputTextField buyerSecurityDepositInputTextField, fixedPriceTextField, marketBasedPriceTextField; @@ -236,7 +235,7 @@ public abstract class MutableOfferView extends addSubscriptions(); if (waitingForFundsSpinner != null) - waitingForFundsSpinner.setProgress(-1); + waitingForFundsSpinner.play(); //directionLabel.setText(model.getDirectionLabel()); amountDescriptionLabel.setText(model.getAmountDescription()); @@ -280,7 +279,7 @@ public abstract class MutableOfferView extends removeSubscriptions(); if (waitingForFundsSpinner != null) - waitingForFundsSpinner.setProgress(0); + waitingForFundsSpinner.stop(); } } @@ -455,7 +454,7 @@ public abstract class MutableOfferView extends .show(); } - waitingForFundsSpinner.setProgress(-1); + waitingForFundsSpinner.play(); payFundsTitledGroupBg.setVisible(true); totalToPayTextField.setVisible(true); @@ -659,7 +658,13 @@ public abstract class MutableOfferView extends private void addSubscriptions() { isWaitingForFundsSubscription = EasyBind.subscribe(model.isWaitingForFunds, isWaitingForFunds -> { - waitingForFundsSpinner.setProgress(isWaitingForFunds ? -1 : 0); + + if (isWaitingForFunds) { + waitingForFundsSpinner.play(); + } else { + waitingForFundsSpinner.stop(); + } + waitingForFundsLabel.setVisible(isWaitingForFunds); waitingForFundsLabel.setManaged(isWaitingForFunds); }); @@ -1151,7 +1156,7 @@ public abstract class MutableOfferView extends Button fundFromExternalWalletButton = new AutoTooltipButton(Res.get("shared.fundFromExternalWalletButton")); fundFromExternalWalletButton.setDefaultButton(false); fundFromExternalWalletButton.setOnAction(e -> GUIUtil.showFeeInfoBeforeExecute(this::openWallet)); - waitingForFundsSpinner = new JFXSpinner(); + waitingForFundsSpinner = new BusyAnimation(false); waitingForFundsLabel = new AutoTooltipLabel(); waitingForFundsLabel.setPadding(new Insets(5, 0, 0, 0)); diff --git a/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferView.java b/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferView.java index c4ef8458d9..7fab39b680 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferView.java @@ -25,6 +25,7 @@ import bisq.desktop.components.AutoTooltipButton; import bisq.desktop.components.AutoTooltipLabel; import bisq.desktop.components.AutoTooltipSlideToggleButton; import bisq.desktop.components.BalanceTextField; +import bisq.desktop.components.BusyAnimation; import bisq.desktop.components.FundsTextField; import bisq.desktop.components.InfoInputTextField; import bisq.desktop.components.InputTextField; @@ -72,7 +73,6 @@ import javax.inject.Inject; import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; -import com.jfoenix.controls.JFXSpinner; import com.jfoenix.controls.JFXTextField; import javafx.scene.control.Button; @@ -147,7 +147,7 @@ public class TakeOfferView extends ActivatableViewAndModel { if (isOfferAvailable) { - offerAvailabilitySpinner.setProgress(0); - offerAvailabilitySpinner.setVisible(false); + offerAvailabilityBusyAnimation.stop(); + offerAvailabilityBusyAnimation.setVisible(false); if (!DevEnv.isDaoActivated() && !model.isRange() && !model.showPayFundsScreenDisplayed.get()) showNextStepAfterAmountIsSet(); } @@ -686,7 +686,7 @@ public class TakeOfferView extends ActivatableViewAndModel { - waitingForFundsSpinner.setProgress(-1); + waitingForFundsBusyAnimation.play(); waitingForFundsLabel.setVisible(isWaitingForFunds); waitingForFundsLabel.setManaged(isWaitingForFunds); }); @@ -938,10 +938,10 @@ public class TakeOfferView extends ActivatableViewAndModel GUIUtil.showFeeInfoBeforeExecute(this::openWallet)); - waitingForFundsSpinner = new JFXSpinner(); + waitingForFundsBusyAnimation = new BusyAnimation(false); waitingForFundsLabel = new AutoTooltipLabel(); waitingForFundsLabel.setPadding(new Insets(5, 0, 0, 0)); fundingHBox.getChildren().addAll(fundFromSavingsWalletButton, label, fundFromExternalWalletButton, - waitingForFundsSpinner, + waitingForFundsBusyAnimation, waitingForFundsLabel); GridPane.setRowIndex(fundingHBox, ++gridRow); diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/BuyerSubView.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/BuyerSubView.java index 486e1c5c1c..faba914fd1 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/BuyerSubView.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/BuyerSubView.java @@ -52,14 +52,17 @@ public class BuyerSubView extends TradeSubView { @Override protected void addWizards() { - step1 = new TradeWizardItem(BuyerStep1View.class, Res.get("portfolio.pending.step1.waitForConf")); - step2 = new TradeWizardItem(BuyerStep2View.class, Res.get("portfolio.pending.step2_buyer.startPayment")); - step3 = new TradeWizardItem(BuyerStep3View.class, Res.get("portfolio.pending.step3_buyer.waitPaymentArrived")); - step4 = new TradeWizardItem(BuyerStep4View.class, Res.get("portfolio.pending.step5.completed")); + step1 = new TradeWizardItem(BuyerStep1View.class, Res.get("portfolio.pending.step1.waitForConf"), "1"); + step2 = new TradeWizardItem(BuyerStep2View.class, Res.get("portfolio.pending.step2_buyer.startPayment"), "2"); + step3 = new TradeWizardItem(BuyerStep3View.class, Res.get("portfolio.pending.step3_buyer.waitPaymentArrived"), "3"); + step4 = new TradeWizardItem(BuyerStep4View.class, Res.get("portfolio.pending.step5.completed"), "4"); addWizardsToGridPane(step1); + addLineSeparatorToGridPane(); addWizardsToGridPane(step2); + addLineSeparatorToGridPane(); addWizardsToGridPane(step3); + addLineSeparatorToGridPane(); addWizardsToGridPane(step4); } 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 f338a9151a..217401b14f 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 @@ -38,8 +38,6 @@ import bisq.network.p2p.NodeAddress; import bisq.common.UserThread; import bisq.common.util.Utilities; -import org.springframework.util.Assert; - import com.google.inject.name.Named; import javax.inject.Inject; @@ -72,6 +70,8 @@ import javafx.util.Callback; import java.util.Comparator; +import static com.google.common.base.Preconditions.checkNotNull; + @FxmlView public class PendingTradesView extends ActivatableViewAndModel { @@ -197,6 +197,7 @@ public class PendingTradesView extends ActivatableViewAndModel { if (isFocused && model.dataModel.selectedItemProperty.get() != null) { // Focus selectedItem from model @@ -486,7 +487,7 @@ public class PendingTradesView extends ActivatableViewAndModel viewClass) { if (tradeStepView != null) tradeStepView.deactivate(); diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/TradeStepView.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/TradeStepView.java index 02b317e662..ad70129497 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/TradeStepView.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/TradeStepView.java @@ -20,11 +20,9 @@ package bisq.desktop.main.portfolio.pendingtrades.steps; import bisq.desktop.components.InfoTextField; import bisq.desktop.components.TitledGroupBg; import bisq.desktop.components.TxIdTextField; -import bisq.desktop.components.paymentmethods.PaymentMethodForm; import bisq.desktop.main.overlays.popups.Popup; import bisq.desktop.main.portfolio.pendingtrades.PendingTradesViewModel; import bisq.desktop.main.portfolio.pendingtrades.TradeSubView; -import bisq.desktop.util.FormBuilder; import bisq.desktop.util.Layout; import bisq.core.arbitration.Dispute; @@ -34,16 +32,23 @@ import bisq.core.user.Preferences; import bisq.common.Clock; import bisq.common.app.Log; +import bisq.common.util.Tuple3; import de.jensd.fx.fontawesome.AwesomeDude; import de.jensd.fx.fontawesome.AwesomeIcon; +import com.jfoenix.controls.JFXProgressBar; + import javafx.scene.control.Label; import javafx.scene.control.ProgressBar; +import javafx.scene.control.ScrollPane; import javafx.scene.control.TextField; import javafx.scene.layout.AnchorPane; +import javafx.scene.layout.ColumnConstraints; import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; +import javafx.scene.layout.Priority; +import javafx.scene.layout.VBox; import javafx.geometry.Insets; @@ -57,6 +62,11 @@ import java.util.Optional; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static bisq.desktop.components.paymentmethods.PaymentMethodForm.addOpenTradeDuration; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField; +import static bisq.desktop.util.FormBuilder.addMultilineLabel; +import static bisq.desktop.util.FormBuilder.addTitledGroupBg; +import static bisq.desktop.util.FormBuilder.addTopLabelTxIdTextField; import static com.google.common.base.Preconditions.checkNotNull; public abstract class TradeStepView extends AnchorPane { @@ -89,9 +99,34 @@ public abstract class TradeStepView extends AnchorPane { this.model = model; preferences = model.dataModel.preferences; trade = model.dataModel.getTrade(); - checkNotNull(trade, "trade must not be null at TradeStepView"); + checkNotNull(trade, "Trade must not be null at TradeStepView"); - gridPane = FormBuilder.addGridPane(this); + ScrollPane scrollPane = new ScrollPane(); + scrollPane.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); + scrollPane.setVbarPolicy(ScrollPane.ScrollBarPolicy.AS_NEEDED); + scrollPane.setFitToHeight(true); + scrollPane.setFitToWidth(true); + + AnchorPane.setLeftAnchor(scrollPane, 10d); + AnchorPane.setRightAnchor(scrollPane, 10d); + AnchorPane.setTopAnchor(scrollPane, 10d); + AnchorPane.setBottomAnchor(scrollPane, 0d); + + getChildren().add(scrollPane); + + gridPane = new GridPane(); + + gridPane.setHgap(Layout.GRID_GAP); + gridPane.setVgap(Layout.GRID_GAP); + ColumnConstraints columnConstraints1 = new ColumnConstraints(); + columnConstraints1.setHgrow(Priority.ALWAYS); + + ColumnConstraints columnConstraints2 = new ColumnConstraints(); + columnConstraints2.setHgrow(Priority.ALWAYS); + + gridPane.getColumnConstraints().addAll(columnConstraints1, columnConstraints2); + + scrollPane.setContent(gridPane); AnchorPane.setLeftAnchor(this, 0d); AnchorPane.setRightAnchor(this, 0d); @@ -185,10 +220,18 @@ public abstract class TradeStepView extends AnchorPane { } protected void addTradeInfoBlock() { - tradeInfoTitledGroupBg = FormBuilder.addTitledGroupBg(gridPane, gridRow, 4, + tradeInfoTitledGroupBg = addTitledGroupBg(gridPane, gridRow, 3, Res.get("portfolio.pending.tradeInformation")); - txIdTextField = FormBuilder.addLabelTxIdTextField(gridPane, gridRow, 1, - Res.getWithCol("shared.depositTransactionId"), Layout.FIRST_ROW_DISTANCE).second; + GridPane.setColumnSpan(tradeInfoTitledGroupBg, 2); + + final Tuple3 labelTxIdTextFieldVBoxTuple3 = + addTopLabelTxIdTextField(gridPane, gridRow, + Res.get("shared.depositTransactionId"), + Layout.COMPACT_FIRST_ROW_DISTANCE); + + GridPane.setColumnSpan(labelTxIdTextFieldVBoxTuple3.third, 2); + txIdTextField = labelTxIdTextFieldVBoxTuple3.second; + String id = model.dataModel.txId.get(); if (!id.isEmpty()) txIdTextField.setup(id); @@ -196,22 +239,26 @@ public abstract class TradeStepView extends AnchorPane { txIdTextField.cleanup(); if (model.dataModel.getTrade() != null) { - InfoTextField infoTextField = PaymentMethodForm.addOpenTradeDuration(gridPane, ++gridRow, + checkNotNull(model.dataModel.getTrade().getOffer(), "Offer must not be null in TradeStepView"); + InfoTextField infoTextField = addOpenTradeDuration(gridPane, ++gridRow, model.dataModel.getTrade().getOffer()); infoTextField.setContentForInfoPopOver(createInfoPopover()); } - timeLeftTextField = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, - Res.getWithCol("portfolio.pending.remainingTime")).second; + final Tuple3 labelTextFieldVBoxTuple3 = addCompactTopLabelTextField(gridPane, gridRow, + 1, Res.get("portfolio.pending.remainingTime"), ""); - timeLeftProgressBar = new ProgressBar(0); + timeLeftTextField = labelTextFieldVBoxTuple3.second; + timeLeftTextField.setMinWidth(400); + + timeLeftProgressBar = new JFXProgressBar(0); timeLeftProgressBar.setOpacity(0.7); timeLeftProgressBar.setMinHeight(9); timeLeftProgressBar.setMaxHeight(9); timeLeftProgressBar.setMaxWidth(Double.MAX_VALUE); GridPane.setRowIndex(timeLeftProgressBar, ++gridRow); - GridPane.setColumnIndex(timeLeftProgressBar, 1); + GridPane.setColumnSpan(timeLeftProgressBar, 2); GridPane.setFillWidth(timeLeftProgressBar, true); gridPane.getChildren().add(timeLeftProgressBar); @@ -219,8 +266,14 @@ public abstract class TradeStepView extends AnchorPane { } protected void addInfoBlock() { - FormBuilder.addTitledGroupBg(gridPane, ++gridRow, 1, getInfoBlockTitle(), Layout.GROUP_DISTANCE); - infoLabel = FormBuilder.addMultilineLabel(gridPane, gridRow, "", Layout.FIRST_ROW_AND_GROUP_DISTANCE); + final TitledGroupBg titledGroupBg = addTitledGroupBg(gridPane, ++gridRow, 1, getInfoBlockTitle(), + Layout.COMPACT_GROUP_DISTANCE); + titledGroupBg.getStyleClass().add("last"); + GridPane.setColumnSpan(titledGroupBg, 2); + + infoLabel = addMultilineLabel(gridPane, gridRow, "", Layout.COMPACT_FIRST_ROW_AND_COMPACT_GROUP_DISTANCE); +// infoLabel = addMultilineLabel(gridPane, gridRow, "", 0); + GridPane.setColumnSpan(infoLabel, 2); } protected String getInfoText() { @@ -455,7 +508,7 @@ public abstract class TradeStepView extends AnchorPane { infoGridPane.setHgap(5); infoGridPane.setVgap(10); infoGridPane.setPadding(new Insets(10, 10, 10, 10)); - Label label = FormBuilder.addMultilineLabel(infoGridPane, rowIndex++, Res.get("portfolio.pending.tradePeriodInfo")); + Label label = addMultilineLabel(infoGridPane, rowIndex++, Res.get("portfolio.pending.tradePeriodInfo")); label.setMaxWidth(450); HBox warningBox = new HBox(); diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/TradeWizardItem.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/TradeWizardItem.java index e7f5f008d9..8ae56a800d 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/TradeWizardItem.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/TradeWizardItem.java @@ -17,30 +17,34 @@ package bisq.desktop.main.portfolio.pendingtrades.steps; -import bisq.desktop.util.Colors; +import de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon; -import de.jensd.fx.fontawesome.AwesomeDude; -import de.jensd.fx.fontawesome.AwesomeIcon; - -import javafx.scene.control.Button; import javafx.scene.control.Label; +import javafx.scene.layout.StackPane; +import javafx.scene.text.Text; -import javafx.geometry.Insets; import javafx.geometry.Pos; -public class TradeWizardItem extends Button { +import org.jetbrains.annotations.NotNull; + +import static bisq.desktop.util.FormBuilder.getBigIcon; + +public class TradeWizardItem extends Label { + private final String iconLabel; + public Class getViewClass() { return viewClass; } private final Class viewClass; - public TradeWizardItem(Class viewClass, String title) { + public TradeWizardItem(Class viewClass, String title, String iconLabel) { this.viewClass = viewClass; + this.iconLabel = iconLabel; setMouseTransparent(true); setText(title); - setPrefHeight(40); +// setPrefHeight(40); setPrefWidth(360); setAlignment(Pos.CENTER_LEFT); setDisabled(); @@ -48,28 +52,30 @@ public class TradeWizardItem extends Button { public void setDisabled() { setId("trade-wizard-item-background-disabled"); - Label icon = new Label(); - icon.setPadding(new Insets(-3, 6, 0, 0)); - icon.setTextFill(Colors.LIGHT_GREY); - AwesomeDude.setIcon(icon, AwesomeIcon.SPINNER); - setGraphic(icon); + setGraphic(getStackPane("trade-step-disabled-bg")); } + public void setActive() { setId("trade-wizard-item-background-active"); - Label icon = new Label(); - icon.setPadding(new Insets(-3, 6, 0, 0)); - icon.setTextFill(Colors.BLUE); - AwesomeDude.setIcon(icon, AwesomeIcon.ARROW_RIGHT); - setGraphic(icon); + setGraphic(getStackPane("trade-step-active-bg")); } public void setCompleted() { - setId("trade-wizard-item-background-completed"); - Label icon = new Label(); - icon.setPadding(new Insets(-3, 6, 0, 0)); - icon.setTextFill(Colors.GREEN); - AwesomeDude.setIcon(icon, AwesomeIcon.OK); + setId("trade-wizard-item-background-active"); + final Text icon = getBigIcon(MaterialDesignIcon.CHECK_CIRCLE); + icon.getStyleClass().add("trade-step-active-bg"); setGraphic(icon); } + + @NotNull + private StackPane getStackPane(String styleClass) { + StackPane stackPane = new StackPane(); + final Label label = new Label(iconLabel); + label.getStyleClass().add("trade-step-label"); + final Text icon = getBigIcon(MaterialDesignIcon.CIRCLE); + icon.getStyleClass().add(styleClass); + stackPane.getChildren().addAll(icon, label); + return stackPane; + } } 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 b593acc863..7b2b76f833 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 @@ -81,12 +81,15 @@ import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; +import javafx.scene.layout.Priority; import org.fxmisc.easybind.EasyBind; import org.fxmisc.easybind.Subscription; import java.util.List; +import static bisq.desktop.util.FormBuilder.addButtonBusyAnimationLabel; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; import static com.google.common.base.Preconditions.checkNotNull; public class BuyerStep2View extends TradeStepView { @@ -189,18 +192,28 @@ public class BuyerStep2View extends TradeStepView { @Override protected void addContent() { + gridPane.getColumnConstraints().get(1).setHgrow(Priority.ALWAYS); + addTradeInfoBlock(); PaymentAccountPayload paymentAccountPayload = model.dataModel.getSellersPaymentAccountPayload(); String paymentMethodId = paymentAccountPayload != null ? paymentAccountPayload.getPaymentMethodId() : ""; - TitledGroupBg accountTitledGroupBg = FormBuilder.addTitledGroupBg(gridPane, ++gridRow, 1, + TitledGroupBg accountTitledGroupBg = FormBuilder.addTitledGroupBg(gridPane, ++gridRow, 2, Res.get("portfolio.pending.step2_buyer.startPaymentUsing", Res.get(paymentMethodId)), - Layout.GROUP_DISTANCE); - TextFieldWithCopyIcon field = FormBuilder.addTopLabelTextFieldWithCopyIcon(gridPane, gridRow, Res.get("portfolio.pending.step2_buyer.amountToTransfer"), + Layout.COMPACT_GROUP_DISTANCE); + accountTitledGroupBg.getStyleClass().add("last"); + TextFieldWithCopyIcon field = addCompactTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 0, + Res.get("portfolio.pending.step2_buyer.amountToTransfer"), model.getFiatVolume(), - Layout.FIRST_ROW_AND_GROUP_DISTANCE).second; + Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE).second; field.setCopyWithoutCurrencyPostFix(true); + if (!(paymentAccountPayload instanceof CryptoCurrencyAccountPayload) && + !(paymentAccountPayload instanceof F2FAccountPayload)) + addCompactTopLabelTextFieldWithCopyIcon(gridPane, gridRow, 1, + Res.get("shared.reasonForPayment"), model.dataModel.getReference(), + Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE); + switch (paymentMethodId) { case PaymentMethod.OK_PAY_ID: gridRow = OKPayForm.addFormForBuyer(gridPane, gridRow, paymentAccountPayload); @@ -290,11 +303,6 @@ public class BuyerStep2View extends TradeStepView { log.error("Not supported PaymentMethod: " + paymentMethodId); } - if (!(paymentAccountPayload instanceof CryptoCurrencyAccountPayload) && - !(paymentAccountPayload instanceof F2FAccountPayload)) - FormBuilder.addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, - Res.getWithCol("shared.reasonForPayment"), model.dataModel.getReference()); - Trade trade = model.getTrade(); if (trade != null && model.getUser().getPaymentAccounts() != null) { Offer offer = trade.getOffer(); @@ -308,16 +316,16 @@ public class BuyerStep2View extends TradeStepView { .findFirst() .ifPresent(paymentAccount -> { String accountName = paymentAccount.getAccountName(); - FormBuilder.addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, - Res.getWithCol("portfolio.pending.step2_buyer.buyerAccount"), accountName); + addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, 0, + Res.get("portfolio.pending.step2_buyer.buyerAccount"), accountName); }); } } GridPane.setRowSpan(accountTitledGroupBg, gridRow - 3); - Tuple4 tuple3 = FormBuilder.addButtonBusyAnimationLabelAfterGroup(gridPane, ++gridRow, - Res.get("portfolio.pending.step2_buyer.paymentStarted")); + Tuple4 tuple3 = addButtonBusyAnimationLabel(gridPane, ++gridRow, 0, + Res.get("portfolio.pending.step2_buyer.paymentStarted"), 10); confirmButton = tuple3.first; confirmButton.setOnAction(e -> onPaymentStarted()); busyAnimation = tuple3.second; diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep3View.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep3View.java index 4e7c62b09f..efb1a2939d 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep3View.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep3View.java @@ -20,7 +20,6 @@ package bisq.desktop.main.portfolio.pendingtrades.steps.buyer; import bisq.desktop.components.TextFieldWithIcon; import bisq.desktop.main.portfolio.pendingtrades.PendingTradesViewModel; import bisq.desktop.main.portfolio.pendingtrades.steps.TradeStepView; -import bisq.desktop.util.FormBuilder; import bisq.desktop.util.Layout; import bisq.core.locale.Res; @@ -33,6 +32,10 @@ import javafx.scene.paint.Paint; import javafx.beans.value.ChangeListener; +import static bisq.desktop.util.FormBuilder.addMultilineLabel; +import static bisq.desktop.util.FormBuilder.addTitledGroupBg; +import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithIcon; + public class BuyerStep3View extends TradeStepView { private final ChangeListener messageStateChangeListener; private TextFieldWithIcon textFieldWithIcon; @@ -72,9 +75,9 @@ public class BuyerStep3View extends TradeStepView { @Override protected void addInfoBlock() { - FormBuilder.addTitledGroupBg(gridPane, ++gridRow, 2, getInfoBlockTitle(), Layout.GROUP_DISTANCE); - infoLabel = FormBuilder.addMultilineLabel(gridPane, gridRow, "", Layout.FIRST_ROW_AND_GROUP_DISTANCE); - textFieldWithIcon = FormBuilder.addLabelTextFieldWithIcon(gridPane, ++gridRow, + addTitledGroupBg(gridPane, ++gridRow, 2, getInfoBlockTitle(), Layout.GROUP_DISTANCE); + infoLabel = addMultilineLabel(gridPane, gridRow, "", Layout.FIRST_ROW_AND_GROUP_DISTANCE); + textFieldWithIcon = addTopLabelTextFieldWithIcon(gridPane, ++gridRow, Res.get("portfolio.pending.step3_buyer.wait.msgStateInfo.label"), 0).second; } diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep4View.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep4View.java index fac422d927..142e642f1c 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep4View.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/buyer/BuyerStep4View.java @@ -29,7 +29,6 @@ import bisq.desktop.main.portfolio.PortfolioView; import bisq.desktop.main.portfolio.closedtrades.ClosedTradesView; import bisq.desktop.main.portfolio.pendingtrades.PendingTradesViewModel; import bisq.desktop.main.portfolio.pendingtrades.steps.TradeStepView; -import bisq.desktop.util.FormBuilder; import bisq.desktop.util.Layout; import bisq.core.btc.exceptions.AddressEntryException; @@ -57,6 +56,7 @@ import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; +import javafx.scene.layout.Priority; import javafx.geometry.Insets; @@ -64,6 +64,10 @@ import org.spongycastle.crypto.params.KeyParameter; import java.util.concurrent.TimeUnit; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField; +import static bisq.desktop.util.FormBuilder.addInputTextField; +import static bisq.desktop.util.FormBuilder.addTitledGroupBg; + public class BuyerStep4View extends TradeStepView { // private final ChangeListener focusedPropertyListener; @@ -122,33 +126,35 @@ public class BuyerStep4View extends TradeStepView { @SuppressWarnings("PointlessBooleanExpression") @Override protected void addContent() { - FormBuilder.addTitledGroupBg(gridPane, gridRow, 5, Res.get("portfolio.pending.step5_buyer.groupTitle"), 0); - FormBuilder.addTopLabelTextField(gridPane, gridRow, getBtcTradeAmountLabel(), model.getTradeVolume(), Layout.FIRST_ROW_DISTANCE); + gridPane.getColumnConstraints().get(1).setHgrow(Priority.SOMETIMES); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, getFiatTradeAmountLabel(), model.getFiatVolume()); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("portfolio.pending.step5_buyer.refunded"), model.getSecurityDeposit()); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("portfolio.pending.step5_buyer.tradeFee"), model.getTradeFee()); + addTitledGroupBg(gridPane, gridRow, 5, Res.get("portfolio.pending.step5_buyer.groupTitle"), 0); + addCompactTopLabelTextField(gridPane, gridRow, getBtcTradeAmountLabel(), model.getTradeVolume(), Layout.FIRST_ROW_DISTANCE); + + addCompactTopLabelTextField(gridPane, ++gridRow, getFiatTradeAmountLabel(), model.getFiatVolume()); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("portfolio.pending.step5_buyer.refunded"), model.getSecurityDeposit()); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("portfolio.pending.step5_buyer.tradeFee"), model.getTradeFee()); final String miningFee = model.dataModel.isMaker() ? Res.get("portfolio.pending.step5_buyer.makersMiningFee") : Res.get("portfolio.pending.step5_buyer.takersMiningFee"); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, miningFee, model.getTxFee()); - withdrawTitledGroupBg = FormBuilder.addTitledGroupBg(gridPane, ++gridRow, 1, Res.get("portfolio.pending.step5_buyer.withdrawBTC"), Layout.GROUP_DISTANCE); - FormBuilder.addTopLabelTextField(gridPane, gridRow, Res.get("portfolio.pending.step5_buyer.amount"), model.getPayoutAmount(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - withdrawAddressTextField = FormBuilder.addInputTextField(gridPane, ++gridRow, Res.get("portfolio.pending.step5_buyer.withdrawToAddress")); + addCompactTopLabelTextField(gridPane, ++gridRow, miningFee, model.getTxFee()); + withdrawTitledGroupBg = addTitledGroupBg(gridPane, ++gridRow, 1, Res.get("portfolio.pending.step5_buyer.withdrawBTC"), Layout.COMPACT_GROUP_DISTANCE); + addCompactTopLabelTextField(gridPane, gridRow, Res.get("portfolio.pending.step5_buyer.amount"), model.getPayoutAmount(), Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE); + withdrawAddressTextField = addInputTextField(gridPane, ++gridRow, Res.get("portfolio.pending.step5_buyer.withdrawToAddress")); withdrawAddressTextField.setManaged(false); withdrawAddressTextField.setVisible(false); HBox hBox = new HBox(); hBox.setSpacing(10); useSavingsWalletButton = new AutoTooltipButton(Res.get("portfolio.pending.step5_buyer.moveToBisqWallet")); - useSavingsWalletButton.setDefaultButton(false); + useSavingsWalletButton.setDefaultButton(true); + useSavingsWalletButton.getStyleClass().add("action-button"); Label label = new AutoTooltipLabel(Res.get("shared.OR")); label.setPadding(new Insets(5, 0, 0, 0)); withdrawToExternalWalletButton = new AutoTooltipButton(Res.get("portfolio.pending.step5_buyer.withdrawExternal")); withdrawToExternalWalletButton.setDefaultButton(false); hBox.getChildren().addAll(useSavingsWalletButton, label, withdrawToExternalWalletButton); GridPane.setRowIndex(hBox, ++gridRow); - GridPane.setColumnIndex(hBox, 1); GridPane.setMargin(hBox, new Insets(15, 10, 0, 0)); gridPane.getChildren().add(hBox); @@ -174,6 +180,10 @@ public class BuyerStep4View extends TradeStepView { withdrawAddressTextField.setVisible(true); GridPane.setRowSpan(withdrawTitledGroupBg, 2); withdrawToExternalWalletButton.setDefaultButton(true); + useSavingsWalletButton.setDefaultButton(false); + withdrawToExternalWalletButton.getStyleClass().add("action-button"); + useSavingsWalletButton.getStyleClass().remove("action-button"); + withdrawToExternalWalletButton.setOnAction(e -> { if (model.dataModel.isReadyForTxBroadcast()) reviewWithdrawal(); diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep2View.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep2View.java index a5f7b9d738..91db9d87bc 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep2View.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep2View.java @@ -20,12 +20,13 @@ package bisq.desktop.main.portfolio.pendingtrades.steps.seller; import bisq.desktop.components.paymentmethods.F2FForm; import bisq.desktop.main.portfolio.pendingtrades.PendingTradesViewModel; import bisq.desktop.main.portfolio.pendingtrades.steps.TradeStepView; -import bisq.desktop.util.FormBuilder; import bisq.desktop.util.Layout; import bisq.core.locale.Res; import bisq.core.payment.payload.F2FAccountPayload; +import static bisq.desktop.util.FormBuilder.addTitledGroupBg; + public class SellerStep2View extends TradeStepView { /////////////////////////////////////////////////////////////////////////////////////////// @@ -41,10 +42,10 @@ public class SellerStep2View extends TradeStepView { addTradeInfoBlock(); addInfoBlock(); if (model.dataModel.getSellersPaymentAccountPayload() instanceof F2FAccountPayload) { - FormBuilder.addTitledGroupBg(gridPane, ++gridRow, 4, - Res.get("portfolio.pending.step2_seller.f2fInfo.headline"), Layout.GROUP_DISTANCE); + addTitledGroupBg(gridPane, ++gridRow, 4, + Res.get("portfolio.pending.step2_seller.f2fInfo.headline"), Layout.COMPACT_GROUP_DISTANCE); gridRow = F2FForm.addFormForBuyer(gridPane, --gridRow, model.dataModel.getSellersPaymentAccountPayload(), - model.dataModel.getTrade().getOffer(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); + model.dataModel.getTrade().getOffer(), Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE); } } diff --git a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java index f6b6a59b75..312f32e523 100644 --- a/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java +++ b/desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/steps/seller/SellerStep3View.java @@ -23,7 +23,6 @@ import bisq.desktop.components.TitledGroupBg; import bisq.desktop.main.overlays.popups.Popup; import bisq.desktop.main.portfolio.pendingtrades.PendingTradesViewModel; import bisq.desktop.main.portfolio.pendingtrades.steps.TradeStepView; -import bisq.desktop.util.FormBuilder; import bisq.desktop.util.Layout; import bisq.core.locale.CurrencyUtil; @@ -54,6 +53,7 @@ import javafx.scene.control.Label; import javafx.scene.control.Tooltip; import javafx.scene.layout.GridPane; import javafx.scene.layout.HBox; +import javafx.scene.layout.Priority; import org.fxmisc.easybind.EasyBind; import org.fxmisc.easybind.Subscription; @@ -61,6 +61,7 @@ import org.fxmisc.easybind.Subscription; import java.util.Optional; import static bisq.desktop.util.FormBuilder.addButtonBusyAnimationLabelAfterGroup; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.FormBuilder.addTitledGroupBg; import static bisq.desktop.util.FormBuilder.addTopLabelTextFieldWithCopyIcon; @@ -159,12 +160,17 @@ public class SellerStep3View extends TradeStepView { @Override protected void addContent() { + + gridPane.getColumnConstraints().get(1).setHgrow(Priority.ALWAYS); + addTradeInfoBlock(); - TitledGroupBg titledGroupBg = addTitledGroupBg(gridPane, ++gridRow, 3, Res.get("portfolio.pending.step3_seller.confirmPaymentReceipt"), Layout.GROUP_DISTANCE); + TitledGroupBg titledGroupBg = addTitledGroupBg(gridPane, ++gridRow, 3, + Res.get("portfolio.pending.step3_seller.confirmPaymentReceipt"), Layout.COMPACT_GROUP_DISTANCE); - TextFieldWithCopyIcon field = FormBuilder.addTopLabelTextFieldWithCopyIcon(gridPane, gridRow, Res.get("portfolio.pending.step3_seller.amountToReceive"), - model.getFiatVolume(), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second; + TextFieldWithCopyIcon field = addTopLabelTextFieldWithCopyIcon(gridPane, gridRow, + Res.get("portfolio.pending.step3_seller.amountToReceive"), + model.getFiatVolume(), Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE).second; field.setCopyWithoutCurrencyPostFix(true); String myPaymentDetails = ""; @@ -191,20 +197,28 @@ public class SellerStep3View extends TradeStepView { } } - TextFieldWithCopyIcon myPaymentDetailsTextField = addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, myTitle, myPaymentDetails).second; - myPaymentDetailsTextField.setMouseTransparent(false); - myPaymentDetailsTextField.setTooltip(new Tooltip(myPaymentDetails)); - - TextFieldWithCopyIcon peersPaymentDetailsTextField = addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, peersTitle, peersPaymentDetails).second; - peersPaymentDetailsTextField.setMouseTransparent(false); - peersPaymentDetailsTextField.setTooltip(new Tooltip(peersPaymentDetails)); - if (!isBlockChain && !trade.getOffer().getPaymentMethod().equals(PaymentMethod.F2F)) { - addTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.getWithCol("shared.reasonForPayment"), model.dataModel.getReference()); + addTopLabelTextFieldWithCopyIcon( + gridPane, gridRow, 1, Res.get("shared.reasonForPayment"), + model.dataModel.getReference(), Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE); GridPane.setRowSpan(titledGroupBg, 4); } - Tuple4 tuple = addButtonBusyAnimationLabelAfterGroup(gridPane, ++gridRow, Res.get("portfolio.pending.step3_seller.confirmReceipt")); + TextFieldWithCopyIcon myPaymentDetailsTextField = addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, + 0, myTitle, myPaymentDetails).second; + myPaymentDetailsTextField.setMouseTransparent(false); + myPaymentDetailsTextField.setTooltip(new Tooltip(myPaymentDetails)); + + TextFieldWithCopyIcon peersPaymentDetailsTextField = addCompactTopLabelTextFieldWithCopyIcon(gridPane, gridRow, + 1, peersTitle, peersPaymentDetails).second; + peersPaymentDetailsTextField.setMouseTransparent(false); + peersPaymentDetailsTextField.setTooltip(new Tooltip(peersPaymentDetails)); + + + Tuple4 tuple = addButtonBusyAnimationLabelAfterGroup(gridPane, ++gridRow, + Res.get("portfolio.pending.step3_seller.confirmReceipt")); + + GridPane.setColumnSpan(tuple.forth, 2); confirmButton = tuple.first; confirmButton.setOnAction(e -> onPaymentReceived()); busyAnimation = tuple.second; diff --git a/desktop/src/main/java/bisq/desktop/util/FormBuilder.java b/desktop/src/main/java/bisq/desktop/util/FormBuilder.java index a1c44a6f16..4b7d6fadc3 100644 --- a/desktop/src/main/java/bisq/desktop/util/FormBuilder.java +++ b/desktop/src/main/java/bisq/desktop/util/FormBuilder.java @@ -189,8 +189,9 @@ public class FormBuilder { Label label = new AutoTooltipLabel(text); label.setWrapText(true); GridPane.setHalignment(label, HPos.LEFT); + GridPane.setHgrow(label, Priority.ALWAYS); GridPane.setRowIndex(label, rowIndex); - GridPane.setMargin(label, new Insets(top, 0, 0, 0)); + GridPane.setMargin(label, new Insets(top + Layout.FLOATING_LABEL_DISTANCE, 0, 0, 0)); gridPane.getChildren().add(label); return label; } @@ -237,6 +238,21 @@ public class FormBuilder { return addTopLabelTextField(gridPane, rowIndex, title, "", 0); } + public static Tuple3 addCompactTopLabelTextField(GridPane gridPane, int rowIndex, String title, String value) { + return addTopLabelTextField(gridPane, rowIndex, title, value, -Layout.FLOATING_LABEL_DISTANCE); + } + + public static Tuple3 addCompactTopLabelTextField(GridPane gridPane, int rowIndex, int colIndex, + String title, String value) { + final Tuple3 labelTextFieldVBoxTuple3 = addTopLabelTextField(gridPane, rowIndex, title, value, -Layout.FLOATING_LABEL_DISTANCE); + GridPane.setColumnIndex(labelTextFieldVBoxTuple3.third, colIndex); + return labelTextFieldVBoxTuple3; + } + + public static Tuple3 addCompactTopLabelTextField(GridPane gridPane, int rowIndex, String title, String value, double top) { + return addTopLabelTextField(gridPane, rowIndex, title, value, top - Layout.FLOATING_LABEL_DISTANCE); + } + public static Tuple3 addTopLabelTextField(GridPane gridPane, int rowIndex, String title, String value) { return addTopLabelTextField(gridPane, rowIndex, title, value, 0); } @@ -300,18 +316,13 @@ public class FormBuilder { /////////////////////////////////////////////////////////////////////////////////////////// - public static Tuple2 addLabelTextFieldWithIcon(GridPane gridPane, int rowIndex, String title, double top) { - Label label = addLabel(gridPane, rowIndex, title, top); + public static Tuple2 addTopLabelTextFieldWithIcon(GridPane gridPane, int rowIndex, String title, double top) { TextFieldWithIcon textFieldWithIcon = new TextFieldWithIcon(); textFieldWithIcon.setMouseTransparent(true); textFieldWithIcon.setFocusTraversable(false); - GridPane.setRowIndex(textFieldWithIcon, rowIndex); - GridPane.setColumnIndex(textFieldWithIcon, 1); - GridPane.setMargin(textFieldWithIcon, new Insets(top, 0, 0, 0)); - gridPane.getChildren().add(textFieldWithIcon); - return new Tuple2<>(label, textFieldWithIcon); + return new Tuple2<>(addTopLabelWithVBox(gridPane, rowIndex, title, textFieldWithIcon, top).first, textFieldWithIcon); } @@ -426,6 +437,10 @@ public class FormBuilder { return addTopLabelTextArea(gridPane, rowIndex, title, prompt, 0); } + public static Tuple2 addTopLabelTextArea(GridPane gridPane, int rowIndex, int colIndex, String title, String prompt) { + return addTopLabelTextArea(gridPane, rowIndex, colIndex, title, prompt, 0); + } + public static Tuple2 addTopLabelTextArea(GridPane gridPane, int rowIndex, String title, String prompt, double top) { TextArea textArea = new JFXTextArea(); @@ -433,7 +448,21 @@ public class FormBuilder { ((JFXTextArea) textArea).setLabelFloat(true); textArea.setWrapText(true); + addTopLabelWithVBox(gridPane, rowIndex, title, textArea, top); + + return addTopLabelTextArea(gridPane, rowIndex, 0, title, prompt, top); + } + + public static Tuple2 addTopLabelTextArea(GridPane gridPane, int rowIndex, int colIndex, + String title, String prompt, double top) { + + TextArea textArea = new JFXTextArea(); + textArea.setPromptText(prompt); + ((JFXTextArea) textArea).setLabelFloat(true); + textArea.setWrapText(true); + final Tuple2 topLabelWithVBox = addTopLabelWithVBox(gridPane, rowIndex, title, textArea, top); + GridPane.setColumnIndex(topLabelWithVBox.second, colIndex); return new Tuple2<>(topLabelWithVBox.first, textArea); } @@ -1120,7 +1149,7 @@ public class FormBuilder { final Tuple2 topLabelWithVBox = addTopLabelWithVBox(gridPane, rowIndex, title, textField, top); - // TOD not 100% sure if that is a good idea.... + // TODO not 100% sure if that is a good idea.... //topLabelWithVBox.first.getStyleClass().add("jfx-text-field-top-label"); return new Tuple3<>(topLabelWithVBox.first, textField, topLabelWithVBox.second); @@ -1131,6 +1160,22 @@ public class FormBuilder { // Label + TextFieldWithCopyIcon /////////////////////////////////////////////////////////////////////////////////////////// + public static Tuple2 addCompactTopLabelTextFieldWithCopyIcon(GridPane gridPane, int rowIndex, String title, String value) { + return addTopLabelTextFieldWithCopyIcon(gridPane, rowIndex, title, value, -Layout.FLOATING_LABEL_DISTANCE); + } + + public static Tuple2 addCompactTopLabelTextFieldWithCopyIcon(GridPane gridPane, int rowIndex, int colIndex, String title, String value, double top) { + return addTopLabelTextFieldWithCopyIcon(gridPane, rowIndex, colIndex, title, value, top - Layout.FLOATING_LABEL_DISTANCE); + } + + public static Tuple2 addCompactTopLabelTextFieldWithCopyIcon(GridPane gridPane, int rowIndex, int colIndex, String title) { + return addTopLabelTextFieldWithCopyIcon(gridPane, rowIndex, colIndex, title, "", -Layout.FLOATING_LABEL_DISTANCE); + } + + public static Tuple2 addCompactTopLabelTextFieldWithCopyIcon(GridPane gridPane, int rowIndex, int colIndex, String title, String value) { + return addTopLabelTextFieldWithCopyIcon(gridPane, rowIndex, colIndex, title, value, -Layout.FLOATING_LABEL_DISTANCE); + } + public static Tuple2 addTopLabelTextFieldWithCopyIcon(GridPane gridPane, int rowIndex, String title, String value) { return addTopLabelTextFieldWithCopyIcon(gridPane, rowIndex, title, value, 0); } @@ -1148,6 +1193,17 @@ public class FormBuilder { return new Tuple2<>(topLabelWithVBox.first, textFieldWithCopyIcon); } + public static Tuple2 addTopLabelTextFieldWithCopyIcon(GridPane gridPane, int rowIndex, int colIndex, String title, String value, double top) { + + TextFieldWithCopyIcon textFieldWithCopyIcon = new TextFieldWithCopyIcon(); + textFieldWithCopyIcon.setText(value); + + final Tuple2 topLabelWithVBox = addTopLabelWithVBox(gridPane, rowIndex, title, textFieldWithCopyIcon, top); + GridPane.setColumnIndex(topLabelWithVBox.second, colIndex); + + return new Tuple2<>(topLabelWithVBox.first, textFieldWithCopyIcon); + } + public static Tuple2 addConfirmationLabelTextFieldWithCopyIcon(GridPane gridPane, int rowIndex, String title, String value) { return addConfirmationLabelTextFieldWithCopyIcon(gridPane, rowIndex, title, value, 0); } @@ -1207,23 +1263,14 @@ public class FormBuilder { // Label + InfoTextField /////////////////////////////////////////////////////////////////////////////////////////// - public static Tuple2 addLabelInfoTextfield(GridPane gridPane, int rowIndex, String labelText, - String fieldText) { - return addLabelInfoTextfield(gridPane, rowIndex, labelText, fieldText, 0); - } - - public static Tuple2 addLabelInfoTextfield(GridPane gridPane, int rowIndex, String labelText, - String fieldText, double top) { - Label label = addLabel(gridPane, rowIndex, labelText, top); - + public static Tuple3 addTopLabelInfoTextField(GridPane gridPane, int rowIndex, String labelText, + String fieldText, double top) { InfoTextField infoTextField = new InfoTextField(); infoTextField.setText(fieldText); - GridPane.setRowIndex(infoTextField, rowIndex); - GridPane.setColumnIndex(infoTextField, 1); - GridPane.setMargin(infoTextField, new Insets(top, 0, 0, 0)); - gridPane.getChildren().add(infoTextField); - return new Tuple2<>(label, infoTextField); + final Tuple2 labelVBoxTuple2 = addTopLabelWithVBox(gridPane, rowIndex, labelText, infoTextField, top); + + return new Tuple3<>(labelVBoxTuple2.first, infoTextField, labelVBoxTuple2.second); } /////////////////////////////////////////////////////////////////////////////////////////// @@ -1491,11 +1538,11 @@ public class FormBuilder { BusyAnimation busyAnimation = new BusyAnimation(false); Label label = new AutoTooltipLabel(); - hBox.setAlignment(Pos.CENTER_RIGHT); + hBox.setAlignment(Pos.CENTER_LEFT); hBox.getChildren().addAll(button, busyAnimation, label); GridPane.setRowIndex(hBox, rowIndex); - GridPane.setHalignment(hBox, HPos.RIGHT); + GridPane.setHalignment(hBox, HPos.LEFT); GridPane.setColumnIndex(hBox, colIndex); GridPane.setMargin(hBox, new Insets(top, 0, 0, 0)); gridPane.getChildren().add(hBox); @@ -1640,10 +1687,18 @@ public class FormBuilder { } public static Text getIcon(GlyphIcons icon) { + return getIcon(icon, "1.231em"); + } + + public static Text getBigIcon(GlyphIcons icon) { + return getIcon(icon, "2em"); + } + + public static Text getIcon(GlyphIcons icon, String iconSize) { Text textIcon; if (icon.fontFamily().equals(MATERIAL_DESIGN_ICONS)) { - textIcon = MaterialDesignIconFactory.get().createIcon(icon, "1.231em"); + textIcon = MaterialDesignIconFactory.get().createIcon(icon, iconSize); } else { throw new IllegalArgumentException("Not supported icon type"); } @@ -1651,6 +1706,7 @@ public class FormBuilder { return textIcon; } + public static Label getIcon(AwesomeIcon icon) { final Label label = new Label(); AwesomeDude.setIcon(label, icon); diff --git a/desktop/src/main/java/bisq/desktop/util/Layout.java b/desktop/src/main/java/bisq/desktop/util/Layout.java index e6f7120d17..e4c647b11d 100644 --- a/desktop/src/main/java/bisq/desktop/util/Layout.java +++ b/desktop/src/main/java/bisq/desktop/util/Layout.java @@ -21,12 +21,14 @@ public class Layout { public static final double INITIAL_SCENE_WIDTH = 1200; public static final double INITIAL_SCENE_HEIGHT = 710; //740 public static final double FIRST_ROW_DISTANCE = 20d; + public static final double COMPACT_FIRST_ROW_DISTANCE = 10d; public static final double TWICE_FIRST_ROW_DISTANCE = 20d * 2; public static final double FLOATING_LABEL_DISTANCE = 20d; public static final double GROUP_DISTANCE = 40d; public static final double COMPACT_GROUP_DISTANCE = 30d; public static final double FIRST_ROW_AND_GROUP_DISTANCE = GROUP_DISTANCE + FIRST_ROW_DISTANCE; public static final double COMPACT_FIRST_ROW_AND_GROUP_DISTANCE = COMPACT_GROUP_DISTANCE + FIRST_ROW_DISTANCE; + public static final double COMPACT_FIRST_ROW_AND_COMPACT_GROUP_DISTANCE = COMPACT_GROUP_DISTANCE + COMPACT_FIRST_ROW_DISTANCE; public static final double TWICE_FIRST_ROW_AND_GROUP_DISTANCE = GROUP_DISTANCE + TWICE_FIRST_ROW_DISTANCE; public static final double PADDING_WINDOW = 20d; public static double PADDING = 10d;