diff --git a/core/src/main/resources/i18n/displayStrings.properties b/core/src/main/resources/i18n/displayStrings.properties index 2bb13313c7..b9b41320d7 100644 --- a/core/src/main/resources/i18n/displayStrings.properties +++ b/core/src/main/resources/i18n/displayStrings.properties @@ -1782,10 +1782,10 @@ Please note that all open offers will be closed automatically when using this to Before you use this tool, please backup your data directory. \ You can do this at \"Account/Backup\".\n\n\ Please report us your problem and file a bug report on GitHub or at the Bisq forum so that we can investigate what was causing the problem. -emptyWalletWindow.balance=Your available wallet balance: -emptyWalletWindow.bsq.btcBalance=Balance of non-BSQ Satoshis: +emptyWalletWindow.balance=Your available wallet balance +emptyWalletWindow.bsq.btcBalance=Balance of non-BSQ Satoshis -emptyWalletWindow.address=Your destination address: +emptyWalletWindow.address=Your destination address emptyWalletWindow.button=Send all funds emptyWalletWindow.openOffers.warn=You have open offers which will be removed if you empty the wallet.\nAre you sure that you want to empty your wallet? emptyWalletWindow.openOffers.yes=Yes, I am sure @@ -2206,6 +2206,7 @@ password.backupReminder=Please note that when setting a wallet password all auto password.backupWasDone=I have already done a backup seed.seedWords=Wallet seed words +seed.enterSeedWords=Enter wallet seed words seed.date=Wallet date seed.restore.title=Restore wallets from seed words seed.restore=Restore wallets @@ -2516,8 +2517,8 @@ validation.accountNrChars=Account number must consist of {0} characters. validation.btc.invalidAddress=The address is not correct. Please check the address format. validation.integerOnly=Please enter integer numbers only. validation.inputError=Your input caused an error:\n{0} -validation.bsq.insufficientBalance=Amount exceeds the available balance of {0}. -validation.btc.exceedsMaxTradeLimit=Amount larger than your trade limit of {0} is not allowed. +validation.bsq.insufficientBalance=Your available balance is {0}. +validation.btc.exceedsMaxTradeLimit=Your trade limit is {0}. validation.bsq.amountBelowMinAmount=Min. amount is {0} validation.nationalAccountId={0} must consist of {1} numbers. diff --git a/desktop/src/main/java/bisq/desktop/bisq.css b/desktop/src/main/java/bisq/desktop/bisq.css index 2f7d91456c..56b215299b 100644 --- a/desktop/src/main/java/bisq/desktop/bisq.css +++ b/desktop/src/main/java/bisq/desktop/bisq.css @@ -428,7 +428,7 @@ bg color of non edit textFields: fafafa -fx-border-color: -bs-rd-grey-background-dark; -fx-border-radius: 3; -fx-pref-height: 43; - -fx-pref-width: 300; + -fx-pref-width: 310; -fx-effect: innershadow(gaussian, -bs-rd-black-transparent, 3, 0, 0, 1); } @@ -1162,7 +1162,7 @@ textfield */ } /* validation */ -#validation-error { +.validation-error { -fx-text-fill: -bs-red; } diff --git a/desktop/src/main/java/bisq/desktop/components/InputTextField.java b/desktop/src/main/java/bisq/desktop/components/InputTextField.java index f89644995b..7aa3496ebc 100644 --- a/desktop/src/main/java/bisq/desktop/components/InputTextField.java +++ b/desktop/src/main/java/bisq/desktop/components/InputTextField.java @@ -71,6 +71,9 @@ public class InputTextField extends JFXTextField { if (newValue.isValid) { resetValidation(); } else { + resetValidation(); + validate(); + jfxValidationWrapper.applyErrorMessage(newValue); } validate(); diff --git a/desktop/src/main/java/bisq/desktop/components/PasswordTextField.java b/desktop/src/main/java/bisq/desktop/components/PasswordTextField.java index 8495fbb017..174eb4ab25 100644 --- a/desktop/src/main/java/bisq/desktop/components/PasswordTextField.java +++ b/desktop/src/main/java/bisq/desktop/components/PasswordTextField.java @@ -23,6 +23,6 @@ public class PasswordTextField extends JFXPasswordField { public PasswordTextField() { super(); setLabelFloat(true); - setMaxWidth(300); + setMaxWidth(380); } } 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 45ed38d705..f7f8b933bf 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/BankForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/BankForm.java @@ -18,7 +18,6 @@ package bisq.desktop.components.paymentmethods; import bisq.desktop.components.InputTextField; -import bisq.desktop.util.FormBuilder; import bisq.desktop.util.GUIUtil; import bisq.desktop.util.Layout; @@ -178,40 +177,40 @@ abstract class BankForm extends GeneralBankForm { gridRowFrom = gridRow; String countryCode = bankAccountPayload.getCountryCode(); - FormBuilder.addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), + addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), paymentAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(paymentAccount.getPaymentMethod().getId())); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.country"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.country"), getCountryBasedPaymentAccount().getCountry() != null ? getCountryBasedPaymentAccount().getCountry().name : ""); TradeCurrency singleTradeCurrency = paymentAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addAcceptedBanksForDisplayAccount(); addHolderNameAndIdForDisplayAccount(); if (BankUtil.isBankNameRequired(countryCode)) - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.bank.name"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.bank.name"), bankAccountPayload.getBankName()).second.setMouseTransparent(false); if (BankUtil.isBankIdRequired(countryCode)) - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, BankUtil.getBankIdLabel(countryCode), + addCompactTopLabelTextField(gridPane, ++gridRow, BankUtil.getBankIdLabel(countryCode), bankAccountPayload.getBankId()).second.setMouseTransparent(false); if (BankUtil.isBranchIdRequired(countryCode)) - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, BankUtil.getBranchIdLabel(countryCode), + addCompactTopLabelTextField(gridPane, ++gridRow, BankUtil.getBranchIdLabel(countryCode), bankAccountPayload.getBranchId()).second.setMouseTransparent(false); if (BankUtil.isNationalAccountIdRequired(countryCode)) - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, BankUtil.getNationalAccountIdLabel(countryCode), + addCompactTopLabelTextField(gridPane, ++gridRow, BankUtil.getNationalAccountIdLabel(countryCode), bankAccountPayload.getNationalAccountId()).second.setMouseTransparent(false); if (BankUtil.isAccountNrRequired(countryCode)) - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, BankUtil.getAccountNrLabel(countryCode), + addCompactTopLabelTextField(gridPane, ++gridRow, BankUtil.getAccountNrLabel(countryCode), bankAccountPayload.getAccountNr()).second.setMouseTransparent(false); if (BankUtil.isAccountTypeRequired(countryCode)) - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, BankUtil.getAccountTypeLabel(countryCode), + addCompactTopLabelTextField(gridPane, ++gridRow, BankUtil.getAccountTypeLabel(countryCode), bankAccountPayload.getAccountType()).second.setMouseTransparent(false); addLimitations(); @@ -427,7 +426,7 @@ abstract class BankForm extends GeneralBankForm { holderNameTextField.setMinWidth(250); tuple.forth.setText(bankAccountPayload.getHolderTaxId()); } else { - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), bankAccountPayload.getHolderName()); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), bankAccountPayload.getHolderName()); } } 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 e76eb00f6a..00f38c69f6 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/ChaseQuickPayForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/ChaseQuickPayForm.java @@ -95,16 +95,16 @@ public class ChaseQuickPayForm extends PaymentMethodForm { gridRowFrom = gridRow; addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), chaseQuickPayAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(chaseQuickPayAccount.getPaymentMethod().getId())); - addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), chaseQuickPayAccount.getHolderName()); - TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), + TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), chaseQuickPayAccount.getEmail()).second; field.setMouseTransparent(false); TradeCurrency singleTradeCurrency = chaseQuickPayAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addCompactTopLabelTextField(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 496a5007e2..cc2f5c6730 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/ClearXchangeForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/ClearXchangeForm.java @@ -35,7 +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; public class ClearXchangeForm extends PaymentMethodForm { private final ClearXchangeAccount clearXchangeAccount; @@ -77,7 +79,7 @@ public class ClearXchangeForm extends PaymentMethodForm { }); final TradeCurrency singleTradeCurrency = clearXchangeAccount.getSingleTradeCurrency(); final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), + addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); addAccountNameTextFieldWithAutoFillToggleButton(); @@ -91,18 +93,18 @@ public class ClearXchangeForm 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"), clearXchangeAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(clearXchangeAccount.getPaymentMethod().getId())); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), clearXchangeAccount.getHolderName()); - TextField field = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email.mobile"), + TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email.mobile"), clearXchangeAccount.getEmailOrMobileNr()).second; field.setMouseTransparent(false); final TradeCurrency singleTradeCurrency = clearXchangeAccount.getSingleTradeCurrency(); final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); } 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 b76b0ca38e..b7292b6a64 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/CryptoCurrencyForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/CryptoCurrencyForm.java @@ -49,6 +49,7 @@ import javafx.util.StringConverter; import java.util.Optional; +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.GUIUtil.getComboBoxButtonCell; @@ -127,15 +128,15 @@ public class CryptoCurrencyForm extends PaymentMethodForm { gridRowFrom = gridRow; addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), cryptoCurrencyAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(cryptoCurrencyAccount.getPaymentMethod().getId())); - Tuple3 tuple2 = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, + Tuple3 tuple2 = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.altcoin.address"), cryptoCurrencyAccount.getAddress()); TextField field = tuple2.second; field.setMouseTransparent(false); final TradeCurrency singleTradeCurrency = cryptoCurrencyAccount.getSingleTradeCurrency(); final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.altcoin"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.altcoin"), nameAndCode); addLimitations(); } 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 974ccb3ea4..111bae1988 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,7 @@ 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.*; public class F2FForm extends PaymentMethodForm { private final F2FAccount f2fAccount; @@ -154,18 +152,18 @@ public class F2FForm extends PaymentMethodForm { addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), paymentAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(paymentAccount.getPaymentMethod().getId())); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.country"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.country"), getCountryBasedPaymentAccount().getCountry() != null ? getCountryBasedPaymentAccount().getCountry().name : ""); TradeCurrency singleTradeCurrency = paymentAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.f2f.contact", f2fAccount.getContact()), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.f2f.contact", f2fAccount.getContact()), f2fAccount.getContact()); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.f2f.city", f2fAccount.getCity()), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.f2f.city", f2fAccount.getCity()), f2fAccount.getCity()); - TextArea textArea = addTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.f2f.extra"), "").second; + TextArea textArea = addCompactTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.f2f.extra"), "").second; textArea.setText(f2fAccount.getExtraInfo()); textArea.setPrefHeight(60); textArea.setEditable(false); 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 574bf77238..ba8f48b3f0 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/FasterPaymentsForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/FasterPaymentsForm.java @@ -100,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); - addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(fasterPaymentsAccount.getPaymentMethod().getId())); // do not translate as it is used in english only - addTopLabelTextField(gridPane, ++gridRow, UK_SORT_CODE, fasterPaymentsAccount.getSortCode()); - TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.accountNr"), + addCompactTopLabelTextField(gridPane, ++gridRow, UK_SORT_CODE, fasterPaymentsAccount.getSortCode()); + TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.accountNr"), fasterPaymentsAccount.getAccountNr()).second; field.setMouseTransparent(false); TradeCurrency singleTradeCurrency = fasterPaymentsAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; - addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); } 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 f1bcab1565..ba02fec4bb 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/HalCashForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/HalCashForm.java @@ -86,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); - addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(halCashAccount.getPaymentMethod().getId())); - TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.mobile"), + TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.mobile"), halCashAccount.getMobileNr()).second; field.setMouseTransparent(false); TradeCurrency singleTradeCurrency = halCashAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addCompactTopLabelTextField(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 cae2cf15ce..d335548a38 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/InteracETransferForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/InteracETransferForm.java @@ -113,19 +113,19 @@ public class InteracETransferForm extends PaymentMethodForm { gridRowFrom = gridRow; addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), interacETransferAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(interacETransferAccount.getPaymentMethod().getId())); - addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), interacETransferAccount.getHolderName()); - addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), interacETransferAccount.getEmail()).second.setMouseTransparent(false); - addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.secret"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.secret"), interacETransferAccount.getQuestion()).second.setMouseTransparent(false); - addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.answer"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.answer"), interacETransferAccount.getAnswer()).second.setMouseTransparent(false); TradeCurrency singleTradeCurrency = interacETransferAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), + addCompactTopLabelTextField(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 1c61ee7e3a..b45d177974 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/MoneyBeamForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/MoneyBeamForm.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.addCompactTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.FormBuilder.addTopLabelTextField; @@ -67,7 +68,7 @@ public class MoneyBeamForm 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(); } @@ -81,12 +82,12 @@ public class MoneyBeamForm 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())); - TextField field = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.moneyBeam.accountId"), account.getAccountId()).second; + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(account.getPaymentMethod().getId())); + TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.moneyBeam.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); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); } 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 90898bad1a..e4034536ab 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/MoneyGramForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/MoneyGramForm.java @@ -18,7 +18,6 @@ package bisq.desktop.components.paymentmethods; import bisq.desktop.components.InputTextField; -import bisq.desktop.util.FormBuilder; import bisq.desktop.util.GUIUtil; import bisq.desktop.util.Layout; import bisq.desktop.util.validation.EmailValidator; @@ -46,9 +45,7 @@ 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.*; @Slf4j public class MoneyGramForm extends PaymentMethodForm { @@ -88,16 +85,16 @@ public class MoneyGramForm extends PaymentMethodForm { public void addFormForDisplayAccount() { gridRowFrom = gridRow; final Country country = getMoneyGramPaymentAccount().getCountry(); - FormBuilder.addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), paymentAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), paymentAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(paymentAccount.getPaymentMethod().getId())); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.country"), country != null ? country.name : ""); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.fullName"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.country"), country != null ? country.name : ""); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.fullName"), moneyGramAccountPayload.getHolderName()); if (BankUtil.isStateRequired(moneyGramAccountPayload.getCountryCode())) - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.state"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.state"), moneyGramAccountPayload.getState()).second.setMouseTransparent(false); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), moneyGramAccountPayload.getEmail()); addLimitations(); addCurrenciesGrid(false); 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 0b3e7904db..1d069ca824 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/PaymentMethodForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/PaymentMethodForm.java @@ -280,12 +280,12 @@ public abstract class PaymentMethodForm { TradeCurrency singleTradeCurrency) { gridRowFrom = gridRow; addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), accountName, Layout.FIRST_ROW_AND_GROUP_DISTANCE); - addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(paymentMethod.getId())); - TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.no"), accountNr).second; + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(paymentMethod.getId())); + TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.no"), accountNr).second; field.setMouseTransparent(false); final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; - addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); } 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 b6efa53b59..f98e5905ed 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/PopmoneyForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/PopmoneyForm.java @@ -92,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); - addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(account.getPaymentMethod().getId())); - addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(account.getPaymentMethod().getId())); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), account.getHolderName()); - TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.popmoney.accountId"), account.getAccountId()).second; + TextField field = addCompactTopLabelTextField(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() : ""; - addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addCompactTopLabelTextField(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 7b4ea774c1..5960a23d36 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/PromptPayForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/PromptPayForm.java @@ -86,14 +86,14 @@ public class PromptPayForm extends PaymentMethodForm { gridRowFrom = gridRow; addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), promptPayAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(promptPayAccount.getPaymentMethod().getId())); - TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.promptPay.promptPayId"), + TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.promptPay.promptPayId"), promptPayAccount.getPromptPayId()).second; field.setMouseTransparent(false); TradeCurrency singleTradeCurrency = promptPayAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); } 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 1120df416d..4386b4a148 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/RevolutForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/RevolutForm.java @@ -36,6 +36,7 @@ import javafx.scene.control.TextField; import javafx.scene.layout.FlowPane; 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.addTopLabelFlowPane; import static bisq.desktop.util.FormBuilder.addTopLabelTextField; @@ -99,9 +100,9 @@ public class RevolutForm extends PaymentMethodForm { 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"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(account.getPaymentMethod().getId())); - TextField field = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.revolut.accountId"), + TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.revolut.accountId"), account.getAccountId()).second; field.setMouseTransparent(false); addLimitations(); 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 8a99086917..6f535f2465 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,9 @@ import javafx.collections.FXCollections; import java.util.List; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField; import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; +import static bisq.desktop.util.FormBuilder.addTopLabelTextField; public class SepaForm extends GeneralSepaForm { @@ -181,17 +183,17 @@ public class SepaForm extends GeneralSepaForm { @Override public void addFormForDisplayAccount() { gridRowFrom = gridRow; - FormBuilder.addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), sepaAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), sepaAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(sepaAccount.getPaymentMethod().getId())); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), sepaAccount.getHolderName()); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, IBAN, sepaAccount.getIban()).second.setMouseTransparent(false); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, BIC, sepaAccount.getBic()).second.setMouseTransparent(false); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.bank.country"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), sepaAccount.getHolderName()); + addCompactTopLabelTextField(gridPane, ++gridRow, IBAN, sepaAccount.getIban()).second.setMouseTransparent(false); + addCompactTopLabelTextField(gridPane, ++gridRow, BIC, sepaAccount.getBic()).second.setMouseTransparent(false); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.bank.country"), sepaAccount.getCountry() != null ? sepaAccount.getCountry().name : ""); TradeCurrency singleTradeCurrency = sepaAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); String countries; Tooltip tooltip = null; if (CountryUtil.containsAllSepaEuroCountries(sepaAccount.getAcceptedCountryCodes())) { @@ -200,7 +202,7 @@ public class SepaForm extends GeneralSepaForm { countries = CountryUtil.getCodesString(sepaAccount.getAcceptedCountryCodes()); tooltip = new Tooltip(CountryUtil.getNamesByCodesString(sepaAccount.getAcceptedCountryCodes())); } - TextField acceptedCountries = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.accepted.countries"), countries).second; + TextField acceptedCountries = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.accepted.countries"), countries).second; if (tooltip != null) { acceptedCountries.setMouseTransparent(false); acceptedCountries.setTooltip(tooltip); 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 0c9414f599..347b127e4c 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,9 @@ import javafx.collections.FXCollections; import java.util.List; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField; import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; +import static bisq.desktop.util.FormBuilder.addTopLabelTextField; public class SepaInstantForm extends GeneralSepaForm { @@ -180,17 +182,17 @@ public class SepaInstantForm extends GeneralSepaForm { @Override public void addFormForDisplayAccount() { gridRowFrom = gridRow; - FormBuilder.addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), sepaInstantAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), sepaInstantAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(sepaInstantAccount.getPaymentMethod().getId())); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), sepaInstantAccount.getHolderName()); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, IBAN, sepaInstantAccount.getIban()).second.setMouseTransparent(false); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, BIC, sepaInstantAccount.getBic()).second.setMouseTransparent(false); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.bank.country"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), sepaInstantAccount.getHolderName()); + addCompactTopLabelTextField(gridPane, ++gridRow, IBAN, sepaInstantAccount.getIban()).second.setMouseTransparent(false); + addCompactTopLabelTextField(gridPane, ++gridRow, BIC, sepaInstantAccount.getBic()).second.setMouseTransparent(false); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.bank.country"), sepaInstantAccount.getCountry() != null ? sepaInstantAccount.getCountry().name : ""); TradeCurrency singleTradeCurrency = sepaInstantAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); String countries; Tooltip tooltip = null; if (CountryUtil.containsAllSepaInstantEuroCountries(sepaInstantAccount.getAcceptedCountryCodes())) { @@ -199,7 +201,7 @@ public class SepaInstantForm extends GeneralSepaForm { countries = CountryUtil.getCodesString(sepaInstantAccount.getAcceptedCountryCodes()); tooltip = new Tooltip(CountryUtil.getNamesByCodesString(sepaInstantAccount.getAcceptedCountryCodes())); } - TextField acceptedCountries = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.accepted.countries"), countries).second; + TextField acceptedCountries = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.accepted.countries"), countries).second; if (tooltip != null) { acceptedCountries.setMouseTransparent(false); acceptedCountries.setTooltip(tooltip); 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 7b37984af8..61f689cb71 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/SwishForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/SwishForm.java @@ -101,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); - addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(swishAccount.getPaymentMethod().getId())); - addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), swishAccount.getHolderName()); - TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.mobile"), + TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.mobile"), swishAccount.getMobileNr()).second; field.setMouseTransparent(false); TradeCurrency singleTradeCurrency = swishAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addCompactTopLabelTextField(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 41b8a6a60c..c22c43253d 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,7 @@ 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.*; public class USPostalMoneyOrderForm extends PaymentMethodForm { private final USPostalMoneyOrderAccount usPostalMoneyOrderAccount; @@ -88,7 +86,7 @@ public class USPostalMoneyOrderForm extends PaymentMethodForm { TradeCurrency singleTradeCurrency = usPostalMoneyOrderAccount.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(); @@ -104,17 +102,17 @@ public class USPostalMoneyOrderForm extends PaymentMethodForm { gridRowFrom = gridRow; addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), usPostalMoneyOrderAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(usPostalMoneyOrderAccount.getPaymentMethod().getId())); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), usPostalMoneyOrderAccount.getHolderName()); - TextArea textArea = addTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.postal.address"), "").second; + TextArea textArea = addCompactTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.postal.address"), "").second; textArea.setText(usPostalMoneyOrderAccount.getPostalAddress()); textArea.setPrefHeight(60); textArea.setEditable(false); TradeCurrency singleTradeCurrency = usPostalMoneyOrderAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); } 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 dac0e35620..ffc2e7e4a9 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/UpholdForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/UpholdForm.java @@ -36,6 +36,7 @@ import javafx.scene.control.TextField; import javafx.scene.layout.FlowPane; 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; @@ -99,9 +100,9 @@ public class UpholdForm extends PaymentMethodForm { gridRowFrom = gridRow; addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), upholdAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(upholdAccount.getPaymentMethod().getId())); - TextField field = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.uphold.accountId"), + TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.uphold.accountId"), upholdAccount.getAccountId()).second; field.setMouseTransparent(false); addLimitations(); 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 b9ddee6472..4d2b8d7d1f 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/VenmoForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/VenmoForm.java @@ -37,6 +37,7 @@ import org.apache.commons.lang3.StringUtils; 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; @@ -100,14 +101,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); - addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(account.getPaymentMethod().getId())); - addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(account.getPaymentMethod().getId())); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), account.getHolderName()); - TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.venmo.venmoUserName"), account.getVenmoUserName()).second; + TextField field = addCompactTopLabelTextField(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() : ""; - addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addLimitations(); } 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 5c8f0090d3..8b048b8b02 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/WesternUnionForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/WesternUnionForm.java @@ -46,7 +46,9 @@ import javafx.scene.layout.GridPane; import lombok.extern.slf4j.Slf4j; +import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField; import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; +import static bisq.desktop.util.FormBuilder.addTopLabelTextField; @Slf4j public class WesternUnionForm extends PaymentMethodForm { @@ -85,23 +87,23 @@ public class WesternUnionForm extends PaymentMethodForm { public void addFormForDisplayAccount() { gridRowFrom = gridRow; - FormBuilder.addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), paymentAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), + addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), paymentAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(paymentAccount.getPaymentMethod().getId())); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.country"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.country"), getCountryBasedPaymentAccount().getCountry() != null ? getCountryBasedPaymentAccount().getCountry().name : ""); TradeCurrency singleTradeCurrency = paymentAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.fullName"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.fullName"), westernUnionAccountPayload.getHolderName()); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.city"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.city"), westernUnionAccountPayload.getCity()).second.setMouseTransparent(false); if (BankUtil.isStateRequired(westernUnionAccountPayload.getCountryCode())) - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.state"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.state"), westernUnionAccountPayload.getState()).second.setMouseTransparent(false); - FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), + addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), westernUnionAccountPayload.getEmail()); addLimitations(); } diff --git a/desktop/src/main/java/bisq/desktop/images.css b/desktop/src/main/java/bisq/desktop/images.css index d7f4894472..a6d14346cb 100644 --- a/desktop/src/main/java/bisq/desktop/images.css +++ b/desktop/src/main/java/bisq/desktop/images.css @@ -295,10 +295,6 @@ -fx-image: url("../../images/btcaverage.png"); } -#spinner { - -fx-image: url("../../images/spinner.png"); -} - #accepted { -fx-image: url("../../images/accepted.png"); } diff --git a/desktop/src/main/java/bisq/desktop/main/account/content/notifications/MobileNotificationsView.java b/desktop/src/main/java/bisq/desktop/main/account/content/notifications/MobileNotificationsView.java index 8fdc6b2987..7735c6738c 100644 --- a/desktop/src/main/java/bisq/desktop/main/account/content/notifications/MobileNotificationsView.java +++ b/desktop/src/main/java/bisq/desktop/main/account/content/notifications/MobileNotificationsView.java @@ -78,8 +78,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Optional; -import static bisq.desktop.util.FormBuilder.addButton; -import static bisq.desktop.util.FormBuilder.addSlideToggleButton; +import static bisq.desktop.util.FormBuilder.*; @FxmlView public class MobileNotificationsView extends ActivatableView { @@ -289,6 +288,7 @@ public class MobileNotificationsView extends ActivatableView { } } + //TODO: never used --> Do we really want to keep it here if we need it? private void onSendTestMsg() { MobileMessage message = null; List messages = null; @@ -393,23 +393,21 @@ public class MobileNotificationsView extends ActivatableView { /////////////////////////////////////////////////////////////////////////////////////////// private void createSetupFields() { - FormBuilder.addTitledGroupBg(root, gridRow, 4, Res.get("account.notifications.setup.title")); + addTitledGroupBg(root, gridRow, 4, Res.get("account.notifications.setup.title")); downloadButton = addButton(root, gridRow, Res.get("account.notifications.download.label"), - Layout.FIRST_ROW_DISTANCE); + Layout.TWICE_FIRST_ROW_DISTANCE); - Tuple3 tuple = FormBuilder.addTopLabel2Buttons(root, ++gridRow, + Tuple3 tuple = addTopLabel2Buttons(root, ++gridRow, Res.get("account.notifications.webcam.label"), Res.get("account.notifications.webcam.button"), Res.get("account.notifications.noWebcam.button"), 0); webCamButton = tuple.second; noWebCamButton = tuple.third; - tokenInputTextField = FormBuilder.addInputTextField(root, ++gridRow, + tokenInputTextField = addInputTextField(root, ++gridRow, Res.get("account.notifications.email.label")); tokenInputTextField.setPromptText(Res.get("account.notifications.email.prompt")); - tokenInputTextFieldListener = (observable, oldValue, newValue) -> { - applyKeyAndToken(newValue); - }; + tokenInputTextFieldListener = (observable, oldValue, newValue) -> applyKeyAndToken(newValue); tokenInputTextField.setManaged(false); tokenInputTextField.setVisible(false); @@ -417,14 +415,14 @@ public class MobileNotificationsView extends ActivatableView { Res.get("account.notifications.testMsg.title")).second; testMsgButton.setDefaultButton(false);*/ - eraseButton = FormBuilder.addTopLabelButton(root, ++gridRow, + eraseButton = addTopLabelButton(root, ++gridRow, Res.get("account.notifications.erase.label"), Res.get("account.notifications.erase.title")).second; eraseButton.setId("notification-erase-button"); } private void createSettingsFields() { - FormBuilder.addTitledGroupBg(root, ++gridRow, 4, + addTitledGroupBg(root, ++gridRow, 4, Res.get("account.notifications.settings.title"), Layout.GROUP_DISTANCE); @@ -464,9 +462,9 @@ public class MobileNotificationsView extends ActivatableView { } private void createMarketAlertFields() { - FormBuilder.addTitledGroupBg(root, ++gridRow, 4, Res.get("account.notifications.marketAlert.title"), + addTitledGroupBg(root, ++gridRow, 4, Res.get("account.notifications.marketAlert.title"), Layout.GROUP_DISTANCE); - paymentAccountsComboBox = FormBuilder.addComboBox(root, gridRow, + paymentAccountsComboBox = FormBuilder.addComboBox(root, gridRow, Res.get("account.notifications.marketAlert.selectPaymentAccount"), Layout.FIRST_ROW_AND_GROUP_DISTANCE); paymentAccountsComboBox.setConverter(new StringConverter<>() { @@ -503,9 +501,7 @@ public class MobileNotificationsView extends ActivatableView { infoInputTextField.setContentForInfoPopOver(createMarketAlertPriceInfoPopupLabel(Res.get("account.notifications.marketAlert.trigger.info"))); infoInputTextField.setIconsRightAligned(); - marketAlertTriggerListener = (observable, oldValue, newValue) -> { - updateMarketAlertFields(); - }; + marketAlertTriggerListener = (observable, oldValue, newValue) -> updateMarketAlertFields(); marketAlertTriggerFocusListener = (observable, oldValue, newValue) -> { if (oldValue && !newValue) { try { @@ -526,12 +522,12 @@ public class MobileNotificationsView extends ActivatableView { } private void createPriceAlertFields() { - FormBuilder.addTitledGroupBg(root, ++gridRow, 4, + addTitledGroupBg(root, ++gridRow, 4, Res.get("account.notifications.priceAlert.title"), 20); - currencyComboBox = FormBuilder.addComboBox(root, gridRow, + currencyComboBox = FormBuilder.addComboBox(root, gridRow, Res.getWithCol("list.currency.select"), 40); currencyComboBox.setPromptText(Res.get("list.currency.select")); - currencyComboBox.setConverter(new StringConverter() { + currencyComboBox.setConverter(new StringConverter<>() { @Override public String toString(TradeCurrency currency) { return currency.getNameAndCode(); @@ -543,7 +539,7 @@ public class MobileNotificationsView extends ActivatableView { } }); - priceAlertHighInputTextField = FormBuilder.addInputTextField(root, ++gridRow, + priceAlertHighInputTextField = addInputTextField(root, ++gridRow, Res.getWithCol("account.notifications.priceAlert.high.label")); priceAlertHighListener = (observable, oldValue, newValue) -> { long priceAlertHighTextFieldValue = getPriceAsLong(priceAlertHighInputTextField); @@ -569,7 +565,7 @@ public class MobileNotificationsView extends ActivatableView { } } }; - priceAlertLowInputTextField = FormBuilder.addInputTextField(root, ++gridRow, + priceAlertLowInputTextField = addInputTextField(root, ++gridRow, Res.getWithCol("account.notifications.priceAlert.low.label")); priceAlertLowListener = (observable, oldValue, newValue) -> { long priceAlertHighTextFieldValue = getPriceAsLong(priceAlertHighInputTextField); @@ -605,12 +601,10 @@ public class MobileNotificationsView extends ActivatableView { // fillPriceAlertFields method. To be sure that we called after the PriceAlertFilter has been removed we delay // to the next frame. The priceFeedServiceListener in the mobileNotificationService might get called before // our listener here. - priceFeedServiceListener = (observable, oldValue, newValue) -> { - UserThread.execute(() -> { - fillPriceAlertFields(); - updatePriceAlertFields(); - }); - }; + priceFeedServiceListener = (observable, oldValue, newValue) -> UserThread.execute(() -> { + fillPriceAlertFields(); + updatePriceAlertFields(); + }); } diff --git a/desktop/src/main/java/bisq/desktop/main/account/content/password/PasswordView.java b/desktop/src/main/java/bisq/desktop/main/account/content/password/PasswordView.java index 95018c1d5c..6a2389c2e8 100644 --- a/desktop/src/main/java/bisq/desktop/main/account/content/password/PasswordView.java +++ b/desktop/src/main/java/bisq/desktop/main/account/content/password/PasswordView.java @@ -28,7 +28,6 @@ import bisq.desktop.main.MainView; import bisq.desktop.main.account.AccountView; import bisq.desktop.main.account.content.seedwords.SeedWordsView; import bisq.desktop.main.overlays.popups.Popup; -import bisq.desktop.util.FormBuilder; import bisq.desktop.util.Layout; import bisq.desktop.util.validation.PasswordValidator; @@ -52,7 +51,9 @@ import javafx.scene.layout.HBox; import javafx.beans.value.ChangeListener; import static bisq.desktop.util.FormBuilder.addButtonBusyAnimationLabel; +import static bisq.desktop.util.FormBuilder.addMultilineLabel; import static bisq.desktop.util.FormBuilder.addPasswordTextField; +import static bisq.desktop.util.FormBuilder.addTitledGroupBg; import static com.google.common.base.Preconditions.checkArgument; @FxmlView @@ -67,7 +68,8 @@ public class PasswordView extends ActivatableView { private AutoTooltipButton pwButton; private TitledGroupBg headline; private int gridRow = 0; - private ChangeListener passwordFieldChangeListener; + private ChangeListener passwordFieldFocusChangeListener; + private ChangeListener passwordFieldTextChangeListener; private ChangeListener repeatedPasswordFieldChangeListener; @@ -84,16 +86,20 @@ public class PasswordView extends ActivatableView { @Override public void initialize() { - headline = FormBuilder.addTitledGroupBg(root, gridRow, 3, ""); - passwordField = addPasswordTextField(root, gridRow, Res.get("password.enterPassword"), Layout.FIRST_ROW_DISTANCE); + headline = addTitledGroupBg(root, gridRow, 3, ""); + passwordField = addPasswordTextField(root, gridRow, Res.get("password.enterPassword"), Layout.TWICE_FIRST_ROW_DISTANCE); final RequiredFieldValidator requiredFieldValidator = new RequiredFieldValidator(); passwordField.getValidators().addAll(requiredFieldValidator, passwordValidator); - passwordFieldChangeListener = (observable, oldValue, newValue) -> { + passwordFieldFocusChangeListener = (observable, oldValue, newValue) -> { if (!newValue) validatePasswords(); }; + passwordFieldTextChangeListener = (observable, oldvalue, newValue) -> { + if (oldvalue != newValue) validatePasswords(); + }; + repeatedPasswordField = addPasswordTextField(root, ++gridRow, Res.get("password.confirmPassword")); - requiredFieldValidator.setMessage("Password can't be empty"); + requiredFieldValidator.setMessage(Res.get("validation.empty")); repeatedPasswordField.getValidators().addAll(requiredFieldValidator, passwordValidator); repeatedPasswordFieldChangeListener = (observable, oldValue, newValue) -> { if (oldValue != newValue) validatePasswords(); @@ -123,8 +129,8 @@ public class PasswordView extends ActivatableView { } }); - FormBuilder.addTitledGroupBg(root, ++gridRow, 1, Res.get("shared.information"), Layout.GROUP_DISTANCE); - FormBuilder.addMultilineLabel(root, gridRow, Res.get("account.password.info"), Layout.FIRST_ROW_AND_GROUP_DISTANCE); + addTitledGroupBg(root, ++gridRow, 1, Res.get("shared.information"), Layout.GROUP_DISTANCE); + addMultilineLabel(root, gridRow, Res.get("account.password.info"), Layout.FIRST_ROW_AND_GROUP_DISTANCE); } private void onApplyPassword(BusyAnimation busyAnimation, Label deriveStatusLabel) { @@ -146,9 +152,7 @@ public class PasswordView extends ActivatableView { new Popup<>() .feedback(Res.get("password.walletDecrypted")) .show(); - passwordField.clear(); - repeatedPasswordField.clear(); - walletsManager.backupWallets(); + backupWalletAndResetFields(); } else { pwButton.setDisable(false); new Popup<>() @@ -161,10 +165,8 @@ public class PasswordView extends ActivatableView { new Popup<>() .feedback(Res.get("password.walletEncrypted")) .show(); - passwordField.clear(); - repeatedPasswordField.clear(); + backupWalletAndResetFields(); walletsManager.clearBackup(); - walletsManager.backupWallets(); } catch (Throwable t) { new Popup<>() .warning(Res.get("password.walletEncryptionFailed")) @@ -172,18 +174,27 @@ public class PasswordView extends ActivatableView { } } setText(); + updatePasswordListeners(); }); } + private void backupWalletAndResetFields() { + passwordField.clear(); + repeatedPasswordField.clear(); + walletsManager.backupWallets(); + } + private void setText() { if (walletsManager.areWalletsEncrypted()) { pwButton.updateText(Res.get("account.password.removePw.button")); headline.setText(Res.get("account.password.removePw.headline")); + repeatedPasswordField.setVisible(false); repeatedPasswordField.setManaged(false); } else { pwButton.updateText(Res.get("account.password.setPw.button")); headline.setText(Res.get("account.password.setPw.headline")); + repeatedPasswordField.setVisible(true); repeatedPasswordField.setManaged(true); } @@ -191,14 +202,26 @@ public class PasswordView extends ActivatableView { @Override protected void activate() { - passwordField.focusedProperty().addListener(passwordFieldChangeListener); - repeatedPasswordField.textProperty().addListener(repeatedPasswordFieldChangeListener); + updatePasswordListeners(); + repeatedPasswordField.textProperty().addListener(repeatedPasswordFieldChangeListener); + } + + private void updatePasswordListeners() { + passwordField.focusedProperty().removeListener(passwordFieldFocusChangeListener); + passwordField.textProperty().removeListener(passwordFieldTextChangeListener); + + if (walletsManager.areWalletsEncrypted()) { + passwordField.textProperty().addListener(passwordFieldTextChangeListener); + } else { + passwordField.focusedProperty().addListener(passwordFieldFocusChangeListener); + } } @Override protected void deactivate() { - passwordField.focusedProperty().removeListener(passwordFieldChangeListener); + passwordField.focusedProperty().removeListener(passwordFieldFocusChangeListener); + passwordField.textProperty().removeListener(passwordFieldTextChangeListener); repeatedPasswordField.textProperty().removeListener(repeatedPasswordFieldChangeListener); } diff --git a/desktop/src/main/java/bisq/desktop/main/account/content/seedwords/SeedWordsView.java b/desktop/src/main/java/bisq/desktop/main/account/content/seedwords/SeedWordsView.java index e60a21fbd8..d4d92ae873 100644 --- a/desktop/src/main/java/bisq/desktop/main/account/content/seedwords/SeedWordsView.java +++ b/desktop/src/main/java/bisq/desktop/main/account/content/seedwords/SeedWordsView.java @@ -117,7 +117,7 @@ public class SeedWordsView extends ActivatableView { seedWordsTextArea.setMaxHeight(40); restoreDatePicker = addTopLabelDatePicker(root, ++gridRow, Res.get("seed.date"), 10).second; - restoreButton = addButtonAfterGroup(root, ++gridRow, Res.get("seed.restore")); + restoreButton = addPrimaryActionButtonAFterGroup(root, ++gridRow, Res.get("seed.restore")); addTitledGroupBg(root, ++gridRow, 1, Res.get("shared.information"), Layout.GROUP_DISTANCE); addMultilineLabel(root, gridRow, Res.get("account.seed.info"), diff --git a/desktop/src/main/java/bisq/desktop/main/market/spread/SpreadView.fxml b/desktop/src/main/java/bisq/desktop/main/market/spread/SpreadView.fxml index 703350bf97..c6091894a7 100644 --- a/desktop/src/main/java/bisq/desktop/main/market/spread/SpreadView.fxml +++ b/desktop/src/main/java/bisq/desktop/main/market/spread/SpreadView.fxml @@ -26,7 +26,7 @@ AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" xmlns:fx="http://javafx.com/fxml"> - + diff --git a/desktop/src/main/java/bisq/desktop/main/market/spread/SpreadView.java b/desktop/src/main/java/bisq/desktop/main/market/spread/SpreadView.java index 35010f3720..ca86cb6b0f 100644 --- a/desktop/src/main/java/bisq/desktop/main/market/spread/SpreadView.java +++ b/desktop/src/main/java/bisq/desktop/main/market/spread/SpreadView.java @@ -39,8 +39,6 @@ import javafx.scene.control.TableView; import javafx.scene.layout.GridPane; import javafx.scene.layout.Priority; -import javafx.geometry.Insets; - import javafx.beans.property.ReadOnlyObjectWrapper; import javafx.collections.ListChangeListener; @@ -73,7 +71,6 @@ public class SpreadView extends ActivatableViewAndModel(); GridPane.setRowIndex(tableView, gridRow); - GridPane.setMargin(tableView, new Insets(-10, -15, -10, -15)); GridPane.setVgrow(tableView, Priority.ALWAYS); GridPane.setHgrow(tableView, Priority.ALWAYS); root.getChildren().add(tableView); diff --git a/desktop/src/main/java/bisq/desktop/main/market/trades/TradesChartsView.fxml b/desktop/src/main/java/bisq/desktop/main/market/trades/TradesChartsView.fxml index 940a2bacf4..0d79220066 100644 --- a/desktop/src/main/java/bisq/desktop/main/market/trades/TradesChartsView.fxml +++ b/desktop/src/main/java/bisq/desktop/main/market/trades/TradesChartsView.fxml @@ -21,7 +21,7 @@ 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 1ac6e54fff..7d60b61adb 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java @@ -132,6 +132,7 @@ public abstract class MutableOfferView extends private ScrollPane scrollPane; protected GridPane gridPane; private TitledGroupBg payFundsTitledGroupBg, setDepositTitledGroupBg, paymentTitledGroupBg; + protected TitledGroupBg amountTitledGroupBg; private BusyAnimation waitingForFundsSpinner; private AutoTooltipButton nextButton, cancelButton1, cancelButton2, placeOfferButton; private Button priceTypeToggleButton; @@ -141,18 +142,22 @@ public abstract class MutableOfferView extends private AddressTextField addressTextField; private BalanceTextField balanceTextField; private FundsTextField totalToPayTextField; - private Label amountDescriptionLabel, - priceCurrencyLabel, priceDescriptionLabel, - volumeDescriptionLabel, - waitingForFundsLabel, marketBasedPriceLabel, percentagePriceDescription, - buyerSecurityDepositBtcLabel, tradeFeeDescriptionLabel, resultLabel, - tradeFeeInBtcLabel, tradeFeeInBsqLabel; + private Label amountDescriptionLabel; + private Label priceCurrencyLabel; + private Label priceDescriptionLabel; + private Label volumeDescriptionLabel; + private Label waitingForFundsLabel; + private Label marketBasedPriceLabel; + private Label percentagePriceDescription; + private Label tradeFeeDescriptionLabel; + private Label resultLabel; + private Label tradeFeeInBtcLabel; + private Label tradeFeeInBsqLabel; protected Label amountBtcLabel, volumeCurrencyLabel, minAmountBtcLabel; private ComboBox paymentAccountsComboBox; private ComboBox currencyComboBox; - private VBox currencySelection; private ImageView qrCodeImageView; - private VBox fixedPriceBox, percentagePriceBox, + private VBox currencySelection, fixedPriceBox, percentagePriceBox, currencyTextFieldBox; private HBox fundingHBox, firstRowHBox, secondRowHBox, placeOfferBox, amountValueCurrencyBox, priceAsPercentageValueCurrencyBox, volumeValueCurrencyBox, priceValueCurrencyBox, @@ -161,7 +166,8 @@ public abstract class MutableOfferView extends private Subscription isWaitingForFundsSubscription, balanceSubscription, cancelButton2StyleSubscription; private ChangeListener amountFocusedListener, minAmountFocusedListener, volumeFocusedListener, buyerSecurityDepositFocusedListener, priceFocusedListener, placeOfferCompletedListener, - priceAsPercentageFocusedListener; + priceAsPercentageFocusedListener, getShowWalletFundedNotificationListener, + tradeFeeInBtcToggleListener, tradeFeeInBsqToggleListener, tradeFeeVisibleListener; private ChangeListener tradeCurrencyCodeListener, errorMessageListener, marketPriceMarginListener, volumeListener; private ChangeListener marketPriceAvailableListener; @@ -171,11 +177,8 @@ public abstract class MutableOfferView extends protected int gridRow = 0; private final List editOfferElements = new ArrayList<>(); private boolean clearXchangeWarningDisplayed, isActivated; - private ChangeListener getShowWalletFundedNotificationListener; private InfoInputTextField marketBasedPriceInfoInputTextField, volumeInfoInputTextField; - protected TitledGroupBg amountTitledGroupBg; private AutoTooltipSlideToggleButton tradeFeeInBtcToggle, tradeFeeInBsqToggle; - private ChangeListener tradeFeeInBtcToggleListener, tradeFeeInBsqToggleListener; private Text xIcon, fakeXIcon; /////////////////////////////////////////////////////////////////////////////////////////// @@ -478,6 +481,8 @@ public abstract class MutableOfferView extends } private void updateOfferElementsStyle() { + GridPane.setColumnSpan(firstRowHBox, 1); + final String activeInputStyle = "input-with-border"; final String readOnlyInputStyle = "input-with-border-readonly"; amountValueCurrencyBox.getStyleClass().remove(activeInputStyle); @@ -510,8 +515,6 @@ public abstract class MutableOfferView extends // unwanted selection events (item 0) currencyComboBox.setOnAction(null); - resetValidationOfInputFields(); - PaymentAccount paymentAccount = paymentAccountsComboBox.getSelectionModel().getSelectedItem(); if (paymentAccount != null) { maybeShowClearXchangeWarning(paymentAccount); @@ -550,19 +553,6 @@ public abstract class MutableOfferView extends updatePriceToggle(); } - private void resetValidationOfInputFields() { - amountTextField.resetValidation(); - amountTextField.validate(); - minAmountTextField.resetValidation(); - minAmountTextField.validate(); - volumeTextField.resetValidation(); - volumeTextField.validate(); - fixedPriceTextField.resetValidation(); - fixedPriceTextField.validate(); - marketBasedPriceTextField.resetValidation(); - marketBasedPriceTextField.validate(); - } - private void onCurrencyComboBoxSelected() { model.onCurrencySelected(currencyComboBox.getSelectionModel().getSelectedItem()); } @@ -599,6 +589,9 @@ public abstract class MutableOfferView extends tradeFeeInBtcLabel.textProperty().bind(model.tradeFeeInBtcWithFiat); tradeFeeInBsqLabel.textProperty().bind(model.tradeFeeInBsqWithFiat); tradeFeeDescriptionLabel.textProperty().bind(model.tradeFeeDescription); + tradeFeeInBtcLabel.visibleProperty().bind(model.isTradeFeeVisible); + tradeFeeInBsqLabel.visibleProperty().bind(model.isTradeFeeVisible); + tradeFeeDescriptionLabel.visibleProperty().bind(model.isTradeFeeVisible); // Validation amountTextField.validationResultProperty().bind(model.amountValidationResult); @@ -646,6 +639,9 @@ public abstract class MutableOfferView extends tradeFeeInBtcLabel.textProperty().unbind(); tradeFeeInBsqLabel.textProperty().unbind(); tradeFeeDescriptionLabel.textProperty().unbind(); + tradeFeeInBtcLabel.visibleProperty().unbind(); + tradeFeeInBsqLabel.visibleProperty().unbind(); + tradeFeeDescriptionLabel.visibleProperty().unbind(); // Validation amountTextField.validationResultProperty().unbind(); @@ -833,6 +829,13 @@ public abstract class MutableOfferView extends setIsCurrencyForMakerFeeBtc(!newValue); }; + + tradeFeeVisibleListener = (observable, oldValue, newValue) -> { + if (DevEnv.isDaoActivated()) { + tradeFeeInBtcToggle.setVisible(newValue); + tradeFeeInBsqToggle.setVisible(newValue); + } + }; } private void setIsCurrencyForMakerFeeBtc(boolean isCurrencyForMakerFeeBtc) { @@ -868,6 +871,8 @@ public abstract class MutableOfferView extends model.marketPriceAvailableProperty.addListener(marketPriceAvailableListener); model.marketPriceMargin.addListener(marketPriceMarginListener); model.volume.addListener(volumeListener); + model.isTradeFeeVisible.addListener(tradeFeeVisibleListener); + tradeFeeInBtcToggle.selectedProperty().addListener(tradeFeeInBtcToggleListener); tradeFeeInBsqToggle.selectedProperty().addListener(tradeFeeInBsqToggleListener); @@ -898,6 +903,7 @@ public abstract class MutableOfferView extends model.marketPriceAvailableProperty.removeListener(marketPriceAvailableListener); model.marketPriceMargin.removeListener(marketPriceMarginListener); model.volume.removeListener(volumeListener); + model.isTradeFeeVisible.removeListener(tradeFeeVisibleListener); tradeFeeInBtcToggle.selectedProperty().removeListener(tradeFeeInBtcToggleListener); tradeFeeInBsqToggle.selectedProperty().removeListener(tradeFeeInBsqToggleListener); @@ -953,9 +959,7 @@ public abstract class MutableOfferView extends columnConstraints1.setMinWidth(200); ColumnConstraints columnConstraints2 = new ColumnConstraints(); columnConstraints2.setHgrow(Priority.ALWAYS); - ColumnConstraints columnConstraints3 = new ColumnConstraints(); - columnConstraints3.setHgrow(Priority.NEVER); - gridPane.getColumnConstraints().addAll(columnConstraints1, columnConstraints2, columnConstraints3); + gridPane.getColumnConstraints().addAll(columnConstraints1, columnConstraints2); scrollPane.setContent(gridPane); } @@ -1110,10 +1114,10 @@ public abstract class MutableOfferView extends Tuple3 tuple = getEditableValueBox( Res.get("createOffer.securityDeposit.prompt")); buyerSecurityDepositInputTextField = tuple.second; - buyerSecurityDepositBtcLabel = tuple.third; + Label buyerSecurityDepositBtcLabel = tuple.third; VBox depositBox = getTradeInputBox(tuple.first, Res.get("createOffer.setDeposit")).second; - depositBox.setMaxWidth(300); + depositBox.setMaxWidth(310); editOfferElements.add(buyerSecurityDepositInputTextField); editOfferElements.add(buyerSecurityDepositBtcLabel); @@ -1304,6 +1308,7 @@ public abstract class MutableOfferView extends firstRowHBox.setSpacing(5); firstRowHBox.setAlignment(Pos.CENTER_LEFT); firstRowHBox.getChildren().addAll(amountBox, xLabel, percentagePriceBox, resultLabel, volumeBox); + GridPane.setColumnSpan(firstRowHBox, 2); GridPane.setRowIndex(firstRowHBox, gridRow); GridPane.setMargin(firstRowHBox, new Insets(Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE, 10, 0, 0)); gridPane.getChildren().add(firstRowHBox); @@ -1409,10 +1414,12 @@ public abstract class MutableOfferView extends tradeFeeInBtcToggle = new AutoTooltipSlideToggleButton(); tradeFeeInBtcToggle.setText("BTC"); + tradeFeeInBtcToggle.setVisible(false); tradeFeeInBtcToggle.setPadding(new Insets(-8, 5, -10, 5)); tradeFeeInBsqToggle = new AutoTooltipSlideToggleButton(); tradeFeeInBsqToggle.setText("BSQ"); + tradeFeeInBsqToggle.setVisible(false); tradeFeeInBsqToggle.setPadding(new Insets(-9, 5, -9, 5)); VBox tradeFeeToggleButtonBox = new VBox(); diff --git a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java index a955123044..a79ec67e9c 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferViewModel.java @@ -117,6 +117,7 @@ public abstract class MutableOfferViewModel ext final StringProperty tradeFeeInBsqWithFiat = new SimpleStringProperty(); final StringProperty tradeFeeCurrencyCode = new SimpleStringProperty(); final StringProperty tradeFeeDescription = new SimpleStringProperty(); + final BooleanProperty isTradeFeeVisible = new SimpleBooleanProperty(false); // Positive % value means always a better price form the maker's perspective: // Buyer (with fiat): lower price as market @@ -491,6 +492,8 @@ public abstract class MutableOfferViewModel ext private void applyMakerFee() { Coin makerFeeAsCoin = dataModel.getMakerFee(); if (makerFeeAsCoin != null) { + isTradeFeeVisible.setValue(true); + tradeFee.set(getFormatterForMakerFee().formatCoin(makerFeeAsCoin)); Coin makerFeeInBtc = dataModel.getMakerFeeInBtc(); 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 761069f014..9913313e4b 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 @@ -161,7 +161,8 @@ public class TakeOfferView extends ActivatableViewAndModel amountFocusedListener, getShowWalletFundedNotificationListener; private InfoInputTextField volumeInfoTextField; private AutoTooltipSlideToggleButton tradeFeeInBtcToggle, tradeFeeInBsqToggle; - private ChangeListener tradeFeeInBtcToggleListener, tradeFeeInBsqToggleListener; + private ChangeListener tradeFeeInBtcToggleListener, tradeFeeInBsqToggleListener, + tradeFeeVisibleListener; /////////////////////////////////////////////////////////////////////////////////////////// // Constructor, lifecycle @@ -232,6 +233,13 @@ public class TakeOfferView extends ActivatableViewAndModel { + if (DevEnv.isDaoActivated()) { + tradeFeeInBtcToggle.setVisible(newValue); + tradeFeeInBsqToggle.setVisible(newValue); + } + }; + GUIUtil.focusWhenAddedToScene(amountTextField); } @@ -602,6 +610,9 @@ public class TakeOfferView extends ActivatableViewAndModel im final StringProperty tradeFeeInBtcWithFiat = new SimpleStringProperty(); final StringProperty tradeFeeInBsqWithFiat = new SimpleStringProperty(); final StringProperty tradeFeeDescription = new SimpleStringProperty(); + final BooleanProperty isTradeFeeVisible = new SimpleBooleanProperty(false); final BooleanProperty isOfferAvailable = new SimpleBooleanProperty(); final BooleanProperty isTakeOfferButtonDisabled = new SimpleBooleanProperty(true); @@ -274,6 +275,8 @@ class TakeOfferViewModel extends ActivatableWithDataModel im private void applyTakerFee() { Coin takerFeeAsCoin = dataModel.getTakerFee(); if (takerFeeAsCoin != null) { + isTradeFeeVisible.setValue(true); + tradeFee.set(getFormatterForTakerFee().formatCoin(takerFeeAsCoin)); Coin makerFeeInBtc = dataModel.getTakerFeeInBtc(); diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/Overlay.java b/desktop/src/main/java/bisq/desktop/main/overlays/Overlay.java index 1a7a9303cb..386872d57b 100644 --- a/desktop/src/main/java/bisq/desktop/main/overlays/Overlay.java +++ b/desktop/src/main/java/bisq/desktop/main/overlays/Overlay.java @@ -856,6 +856,7 @@ public abstract class Overlay { else hBox.getChildren().addAll(spacer, actionButton); HBox.setHgrow(spacer, Priority.ALWAYS); + spacer.setMaxWidth(Double.MAX_VALUE); GridPane.setHalignment(hBox, HPos.RIGHT); GridPane.setRowIndex(hBox, ++rowIndex); @@ -865,6 +866,7 @@ public abstract class Overlay { } else if (!hideCloseButton) { closeButton.setDefaultButton(true); GridPane.setHalignment(closeButton, HPos.RIGHT); + GridPane.setColumnSpan(closeButton, 2); if (!showReportErrorButtons) GridPane.setMargin(closeButton, new Insets(buttonDistance, 0, 0, 0)); GridPane.setRowIndex(closeButton, ++rowIndex); diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/windows/EmptyWalletWindow.java b/desktop/src/main/java/bisq/desktop/main/overlays/windows/EmptyWalletWindow.java index 0632e2eaea..1ce6662f5a 100644 --- a/desktop/src/main/java/bisq/desktop/main/overlays/windows/EmptyWalletWindow.java +++ b/desktop/src/main/java/bisq/desktop/main/overlays/windows/EmptyWalletWindow.java @@ -21,7 +21,6 @@ import bisq.desktop.components.AutoTooltipButton; import bisq.desktop.components.InputTextField; import bisq.desktop.main.overlays.Overlay; import bisq.desktop.main.overlays.popups.Popup; -import bisq.desktop.util.FormBuilder; import bisq.desktop.util.GUIUtil; import bisq.desktop.util.Transitions; @@ -61,6 +60,7 @@ import java.util.concurrent.TimeUnit; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static bisq.desktop.util.FormBuilder.addInputTextField; import static bisq.desktop.util.FormBuilder.addMultilineLabel; import static bisq.desktop.util.FormBuilder.addTopLabelTextField; @@ -152,7 +152,7 @@ public class EmptyWalletWindow extends Overlay { getFormatter().formatCoinWithCode(totalBalance), 10).second; if (isBtc) { - addressInputTextField = FormBuilder.addInputTextField(gridPane, ++rowIndex, Res.get("emptyWalletWindow.address")); + addressInputTextField = addInputTextField(gridPane, ++rowIndex, Res.get("emptyWalletWindow.address")); } else { addTopLabelTextField(gridPane, ++rowIndex, Res.get("emptyWalletWindow.bsq.btcBalance"), bsqFormatter.formatBTCWithCode(bsqWalletService.getAvailableNonBsqBalance().value), 10); @@ -190,7 +190,6 @@ public class EmptyWalletWindow extends Overlay { HBox hBox = new HBox(); hBox.setSpacing(10); GridPane.setRowIndex(hBox, ++rowIndex); - GridPane.setColumnIndex(hBox, 1); if (isBtc) hBox.getChildren().addAll(emptyWalletButton, closeButton); diff --git a/desktop/src/main/java/bisq/desktop/main/overlays/windows/WalletPasswordWindow.java b/desktop/src/main/java/bisq/desktop/main/overlays/windows/WalletPasswordWindow.java index 73d24fc543..9e61bc8c59 100644 --- a/desktop/src/main/java/bisq/desktop/main/overlays/windows/WalletPasswordWindow.java +++ b/desktop/src/main/java/bisq/desktop/main/overlays/windows/WalletPasswordWindow.java @@ -23,7 +23,6 @@ import bisq.desktop.components.BusyAnimation; import bisq.desktop.components.PasswordTextField; import bisq.desktop.main.overlays.Overlay; import bisq.desktop.main.overlays.popups.Popup; -import bisq.desktop.util.FormBuilder; import bisq.desktop.util.GUIUtil; import bisq.desktop.util.Transitions; @@ -49,7 +48,6 @@ import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.control.DatePicker; import javafx.scene.control.Label; -import javafx.scene.control.Separator; import javafx.scene.control.TextArea; import javafx.scene.input.KeyCode; import javafx.scene.layout.ColumnConstraints; @@ -59,7 +57,6 @@ import javafx.scene.layout.Priority; import javafx.geometry.HPos; import javafx.geometry.Insets; -import javafx.geometry.Orientation; import javafx.geometry.Pos; import javafx.beans.property.BooleanProperty; @@ -80,7 +77,9 @@ import java.util.concurrent.TimeUnit; import lombok.extern.slf4j.Slf4j; -import static bisq.desktop.util.FormBuilder.addButton; +import static bisq.desktop.util.FormBuilder.addPasswordTextField; +import static bisq.desktop.util.FormBuilder.addPrimaryActionButton; +import static bisq.desktop.util.FormBuilder.addTextArea; import static bisq.desktop.util.FormBuilder.addTopLabelDatePicker; import static com.google.common.base.Preconditions.checkArgument; import static javafx.beans.binding.Bindings.createBooleanBinding; @@ -102,7 +101,6 @@ public class WalletPasswordWindow extends Overlay { private ChangeListener changeListener; private ChangeListener wordsTextAreaChangeListener; private ChangeListener seedWordsValidChangeListener; - private LocalDate walletCreationDate; private boolean hideForgotPasswordButton = false; @@ -120,7 +118,7 @@ public class WalletPasswordWindow extends Overlay { this.walletsManager = walletsManager; this.storageDir = storageDir; type = Type.Attention; - width = 868; + width = 900; } @@ -191,18 +189,11 @@ public class WalletPasswordWindow extends Overlay { } private void addInputFields() { - Label label = new AutoTooltipLabel(Res.get("password.enterPassword")); - label.setWrapText(true); - GridPane.setMargin(label, new Insets(3, 0, 0, 0)); - GridPane.setRowIndex(label, ++rowIndex); - - passwordTextField = new PasswordTextField(); - GridPane.setMargin(passwordTextField, new Insets(3, 0, 0, 0)); - GridPane.setRowIndex(passwordTextField, rowIndex); - GridPane.setColumnIndex(passwordTextField, 1); + passwordTextField = addPasswordTextField(gridPane, ++rowIndex, Res.get("password.enterPassword")); + GridPane.setColumnSpan(passwordTextField, 1); + GridPane.setHalignment(passwordTextField, HPos.LEFT); changeListener = (observable, oldValue, newValue) -> unlockButton.setDisable(!passwordTextField.validate()); passwordTextField.textProperty().addListener(changeListener); - gridPane.getChildren().addAll(label, passwordTextField); } private void addButtons() { @@ -211,6 +202,7 @@ public class WalletPasswordWindow extends Overlay { unlockButton = new AutoTooltipButton(Res.get("shared.unlock")); unlockButton.setDefaultButton(true); + unlockButton.getStyleClass().add("action-button"); unlockButton.setDisable(true); unlockButton.setOnAction(e -> { String password = passwordTextField.getText(); @@ -254,9 +246,9 @@ public class WalletPasswordWindow extends Overlay { HBox hBox = new HBox(); hBox.setMinWidth(560); + hBox.setPadding(new Insets(15, 0, 0, 0)); hBox.setSpacing(10); GridPane.setRowIndex(hBox, ++rowIndex); - GridPane.setColumnIndex(hBox, 1); hBox.setAlignment(Pos.CENTER_LEFT); hBox.getChildren().add(unlockButton); if (!hideForgotPasswordButton) @@ -268,48 +260,34 @@ public class WalletPasswordWindow extends Overlay { ColumnConstraints columnConstraints1 = new ColumnConstraints(); - columnConstraints1.setHalignment(HPos.RIGHT); - columnConstraints1.setHgrow(Priority.SOMETIMES); - ColumnConstraints columnConstraints2 = new ColumnConstraints(); - columnConstraints2.setHgrow(Priority.ALWAYS); - gridPane.getColumnConstraints().addAll(columnConstraints1, columnConstraints2); + columnConstraints1.setHalignment(HPos.LEFT); + columnConstraints1.setHgrow(Priority.ALWAYS); + gridPane.getColumnConstraints().addAll(columnConstraints1); } private void showRestoreScreen() { Label headLine2Label = new AutoTooltipLabel(Res.get("seed.restore.title")); - headLine2Label.setId("popup-headline"); + headLine2Label.getStyleClass().add("popup-headline"); headLine2Label.setMouseTransparent(true); GridPane.setHalignment(headLine2Label, HPos.LEFT); GridPane.setRowIndex(headLine2Label, ++rowIndex); - GridPane.setColumnSpan(headLine2Label, 2); GridPane.setMargin(headLine2Label, new Insets(30, 0, 0, 0)); gridPane.getChildren().add(headLine2Label); - Separator separator = new Separator(); - separator.setMouseTransparent(true); - separator.setOrientation(Orientation.HORIZONTAL); - separator.getStyleClass().add("separator"); - GridPane.setHalignment(separator, HPos.CENTER); - GridPane.setRowIndex(separator, ++rowIndex); - GridPane.setColumnSpan(separator, 2); - - gridPane.getChildren().add(separator); - - Tuple2 tuple = FormBuilder.addTopLabelTextArea(gridPane, ++rowIndex, Res.get("seed.seedWords"), "", 5); - seedWordsTextArea = tuple.second; + seedWordsTextArea = addTextArea(gridPane, ++rowIndex, Res.get("seed.enterSeedWords"), 5); + ; seedWordsTextArea.setPrefHeight(60); - seedWordsTextArea.getStyleClass().add("text-area"); Tuple2 labelDatePickerTuple2 = addTopLabelDatePicker(gridPane, ++rowIndex, Res.get("seed.creationDate"), 10); datePicker = labelDatePickerTuple2.second; - restoreButton = addButton(gridPane, ++rowIndex, Res.get("seed.restore")); + restoreButton = addPrimaryActionButton(gridPane, ++rowIndex, Res.get("seed.restore"), 0); restoreButton.setDefaultButton(true); - stage.setHeight(340); + stage.setHeight(570); // wallet creation date is not encrypted - walletCreationDate = Instant.ofEpochSecond(walletsManager.getChainSeedCreationTimeSeconds()).atZone(ZoneId.systemDefault()).toLocalDate(); + LocalDate walletCreationDate = Instant.ofEpochSecond(walletsManager.getChainSeedCreationTimeSeconds()).atZone(ZoneId.systemDefault()).toLocalDate(); log.info("walletCreationDate " + walletCreationDate); datePicker.setValue(walletCreationDate); restoreButton.disableProperty().bind(createBooleanBinding(() -> !seedWordsValid.get() || !seedWordsEdited.get(), diff --git a/desktop/src/main/java/bisq/desktop/main/settings/preferences/PreferencesView.java b/desktop/src/main/java/bisq/desktop/main/settings/preferences/PreferencesView.java index dbe0e5ad9b..78ebf54382 100644 --- a/desktop/src/main/java/bisq/desktop/main/settings/preferences/PreferencesView.java +++ b/desktop/src/main/java/bisq/desktop/main/settings/preferences/PreferencesView.java @@ -354,6 +354,18 @@ public class PreferencesView extends ActivatableViewAndModel() { + @Override + public String toString(TradeCurrency object) { + return object.getCode() + " - " + object.getName(); + } + + @Override + public TradeCurrency fromString(String string) { + return null; + } + }); + preferredTradeCurrencyComboBox.setButtonCell(GUIUtil.getTradeCurrencyButtonCell("", "", Collections.emptyMap())); preferredTradeCurrencyComboBox.setCellFactory(GUIUtil.getTradeCurrencyCellFactory("", "", diff --git a/desktop/src/main/java/bisq/desktop/util/FormBuilder.java b/desktop/src/main/java/bisq/desktop/util/FormBuilder.java index d2f268058e..2b47ba2835 100644 --- a/desktop/src/main/java/bisq/desktop/util/FormBuilder.java +++ b/desktop/src/main/java/bisq/desktop/util/FormBuilder.java @@ -434,6 +434,10 @@ public class FormBuilder { // Label + TextArea /////////////////////////////////////////////////////////////////////////////////////////// + public static Tuple2 addCompactTopLabelTextArea(GridPane gridPane, int rowIndex, String title, String prompt) { + return addTopLabelTextArea(gridPane, rowIndex, title, prompt, -Layout.FLOATING_LABEL_DISTANCE); + } + public static Tuple2 addTopLabelTextArea(GridPane gridPane, int rowIndex, String title, String prompt) { return addTopLabelTextArea(gridPane, rowIndex, title, prompt, 0); } @@ -1385,6 +1389,10 @@ public class FormBuilder { return addButton(gridPane, rowIndex, title, top, true); } + public static Button addPrimaryActionButtonAFterGroup(GridPane gridPane, int rowIndex, String title) { + return addPrimaryActionButton(gridPane, rowIndex, title, 15); + } + public static Button addButton(GridPane gridPane, int rowIndex, String title, double top) { return addButton(gridPane, rowIndex, title, top, false); } diff --git a/desktop/src/main/resources/images/logo_splash.png b/desktop/src/main/resources/images/logo_splash.png index 0b0443e5fb..086c773080 100644 Binary files a/desktop/src/main/resources/images/logo_splash.png and b/desktop/src/main/resources/images/logo_splash.png differ diff --git a/desktop/src/main/resources/images/logo_splash@2x.png b/desktop/src/main/resources/images/logo_splash@2x.png index 086c773080..dab282893c 100644 Binary files a/desktop/src/main/resources/images/logo_splash@2x.png and b/desktop/src/main/resources/images/logo_splash@2x.png differ diff --git a/desktop/src/main/resources/images/spinner.png b/desktop/src/main/resources/images/spinner.png deleted file mode 100644 index 113145c538..0000000000 Binary files a/desktop/src/main/resources/images/spinner.png and /dev/null differ diff --git a/desktop/src/main/resources/images/spinner@2x.png b/desktop/src/main/resources/images/spinner@2x.png deleted file mode 100644 index 15bddbdb2e..0000000000 Binary files a/desktop/src/main/resources/images/spinner@2x.png and /dev/null differ