Merge pull request #1923 from ripcurlx/ui-improvements

Redesign: UI improvements
This commit is contained in:
Manfred Karrer 2018-11-14 16:11:21 -05:00 committed by GitHub
commit d0e2c73428
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
45 changed files with 300 additions and 253 deletions

View File

@ -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. \ Before you use this tool, please backup your data directory. \
You can do this at \"Account/Backup\".\n\n\ 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. 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.balance=Your available wallet balance
emptyWalletWindow.bsq.btcBalance=Balance of non-BSQ Satoshis: emptyWalletWindow.bsq.btcBalance=Balance of non-BSQ Satoshis
emptyWalletWindow.address=Your destination address: emptyWalletWindow.address=Your destination address
emptyWalletWindow.button=Send all funds 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.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 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 password.backupWasDone=I have already done a backup
seed.seedWords=Wallet seed words seed.seedWords=Wallet seed words
seed.enterSeedWords=Enter wallet seed words
seed.date=Wallet date seed.date=Wallet date
seed.restore.title=Restore wallets from seed words seed.restore.title=Restore wallets from seed words
seed.restore=Restore wallets 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.btc.invalidAddress=The address is not correct. Please check the address format.
validation.integerOnly=Please enter integer numbers only. validation.integerOnly=Please enter integer numbers only.
validation.inputError=Your input caused an error:\n{0} validation.inputError=Your input caused an error:\n{0}
validation.bsq.insufficientBalance=Amount exceeds the available balance of {0}. validation.bsq.insufficientBalance=Your available balance is {0}.
validation.btc.exceedsMaxTradeLimit=Amount larger than your trade limit of {0} is not allowed. validation.btc.exceedsMaxTradeLimit=Your trade limit is {0}.
validation.bsq.amountBelowMinAmount=Min. amount is {0} validation.bsq.amountBelowMinAmount=Min. amount is {0}
validation.nationalAccountId={0} must consist of {1} numbers. validation.nationalAccountId={0} must consist of {1} numbers.

View File

@ -428,7 +428,7 @@ bg color of non edit textFields: fafafa
-fx-border-color: -bs-rd-grey-background-dark; -fx-border-color: -bs-rd-grey-background-dark;
-fx-border-radius: 3; -fx-border-radius: 3;
-fx-pref-height: 43; -fx-pref-height: 43;
-fx-pref-width: 300; -fx-pref-width: 310;
-fx-effect: innershadow(gaussian, -bs-rd-black-transparent, 3, 0, 0, 1); -fx-effect: innershadow(gaussian, -bs-rd-black-transparent, 3, 0, 0, 1);
} }
@ -1162,7 +1162,7 @@ textfield */
} }
/* validation */ /* validation */
#validation-error { .validation-error {
-fx-text-fill: -bs-red; -fx-text-fill: -bs-red;
} }

View File

@ -71,6 +71,9 @@ public class InputTextField extends JFXTextField {
if (newValue.isValid) { if (newValue.isValid) {
resetValidation(); resetValidation();
} else { } else {
resetValidation();
validate();
jfxValidationWrapper.applyErrorMessage(newValue); jfxValidationWrapper.applyErrorMessage(newValue);
} }
validate(); validate();

View File

@ -23,6 +23,6 @@ public class PasswordTextField extends JFXPasswordField {
public PasswordTextField() { public PasswordTextField() {
super(); super();
setLabelFloat(true); setLabelFloat(true);
setMaxWidth(300); setMaxWidth(380);
} }
} }

View File

@ -18,7 +18,6 @@
package bisq.desktop.components.paymentmethods; package bisq.desktop.components.paymentmethods;
import bisq.desktop.components.InputTextField; import bisq.desktop.components.InputTextField;
import bisq.desktop.util.FormBuilder;
import bisq.desktop.util.GUIUtil; import bisq.desktop.util.GUIUtil;
import bisq.desktop.util.Layout; import bisq.desktop.util.Layout;
@ -178,40 +177,40 @@ abstract class BankForm extends GeneralBankForm {
gridRowFrom = gridRow; gridRowFrom = gridRow;
String countryCode = bankAccountPayload.getCountryCode(); 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); 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())); 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 : ""); getCountryBasedPaymentAccount().getCountry() != null ? getCountryBasedPaymentAccount().getCountry().name : "");
TradeCurrency singleTradeCurrency = paymentAccount.getSingleTradeCurrency(); TradeCurrency singleTradeCurrency = paymentAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; 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(); addAcceptedBanksForDisplayAccount();
addHolderNameAndIdForDisplayAccount(); addHolderNameAndIdForDisplayAccount();
if (BankUtil.isBankNameRequired(countryCode)) 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); bankAccountPayload.getBankName()).second.setMouseTransparent(false);
if (BankUtil.isBankIdRequired(countryCode)) if (BankUtil.isBankIdRequired(countryCode))
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, BankUtil.getBankIdLabel(countryCode), addCompactTopLabelTextField(gridPane, ++gridRow, BankUtil.getBankIdLabel(countryCode),
bankAccountPayload.getBankId()).second.setMouseTransparent(false); bankAccountPayload.getBankId()).second.setMouseTransparent(false);
if (BankUtil.isBranchIdRequired(countryCode)) if (BankUtil.isBranchIdRequired(countryCode))
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, BankUtil.getBranchIdLabel(countryCode), addCompactTopLabelTextField(gridPane, ++gridRow, BankUtil.getBranchIdLabel(countryCode),
bankAccountPayload.getBranchId()).second.setMouseTransparent(false); bankAccountPayload.getBranchId()).second.setMouseTransparent(false);
if (BankUtil.isNationalAccountIdRequired(countryCode)) if (BankUtil.isNationalAccountIdRequired(countryCode))
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, BankUtil.getNationalAccountIdLabel(countryCode), addCompactTopLabelTextField(gridPane, ++gridRow, BankUtil.getNationalAccountIdLabel(countryCode),
bankAccountPayload.getNationalAccountId()).second.setMouseTransparent(false); bankAccountPayload.getNationalAccountId()).second.setMouseTransparent(false);
if (BankUtil.isAccountNrRequired(countryCode)) if (BankUtil.isAccountNrRequired(countryCode))
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, BankUtil.getAccountNrLabel(countryCode), addCompactTopLabelTextField(gridPane, ++gridRow, BankUtil.getAccountNrLabel(countryCode),
bankAccountPayload.getAccountNr()).second.setMouseTransparent(false); bankAccountPayload.getAccountNr()).second.setMouseTransparent(false);
if (BankUtil.isAccountTypeRequired(countryCode)) if (BankUtil.isAccountTypeRequired(countryCode))
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, BankUtil.getAccountTypeLabel(countryCode), addCompactTopLabelTextField(gridPane, ++gridRow, BankUtil.getAccountTypeLabel(countryCode),
bankAccountPayload.getAccountType()).second.setMouseTransparent(false); bankAccountPayload.getAccountType()).second.setMouseTransparent(false);
addLimitations(); addLimitations();
@ -427,7 +426,7 @@ abstract class BankForm extends GeneralBankForm {
holderNameTextField.setMinWidth(250); holderNameTextField.setMinWidth(250);
tuple.forth.setText(bankAccountPayload.getHolderTaxId()); tuple.forth.setText(bankAccountPayload.getHolderTaxId());
} else { } else {
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), bankAccountPayload.getHolderName()); addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), bankAccountPayload.getHolderName());
} }
} }

View File

@ -95,16 +95,16 @@ public class ChaseQuickPayForm extends PaymentMethodForm {
gridRowFrom = gridRow; gridRowFrom = gridRow;
addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"),
chaseQuickPayAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); 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())); Res.get(chaseQuickPayAccount.getPaymentMethod().getId()));
addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"),
chaseQuickPayAccount.getHolderName()); chaseQuickPayAccount.getHolderName());
TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"),
chaseQuickPayAccount.getEmail()).second; chaseQuickPayAccount.getEmail()).second;
field.setMouseTransparent(false); field.setMouseTransparent(false);
TradeCurrency singleTradeCurrency = chaseQuickPayAccount.getSingleTradeCurrency(); TradeCurrency singleTradeCurrency = chaseQuickPayAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations(); addLimitations();
} }

View File

@ -35,7 +35,9 @@ import bisq.core.util.validation.InputValidator;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane; 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.addCompactTopLabelTextFieldWithCopyIcon;
import static bisq.desktop.util.FormBuilder.addTopLabelTextField;
public class ClearXchangeForm extends PaymentMethodForm { public class ClearXchangeForm extends PaymentMethodForm {
private final ClearXchangeAccount clearXchangeAccount; private final ClearXchangeAccount clearXchangeAccount;
@ -77,7 +79,7 @@ public class ClearXchangeForm extends PaymentMethodForm {
}); });
final TradeCurrency singleTradeCurrency = clearXchangeAccount.getSingleTradeCurrency(); final TradeCurrency singleTradeCurrency = clearXchangeAccount.getSingleTradeCurrency();
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"),
nameAndCode); nameAndCode);
addLimitations(); addLimitations();
addAccountNameTextFieldWithAutoFillToggleButton(); addAccountNameTextFieldWithAutoFillToggleButton();
@ -91,18 +93,18 @@ public class ClearXchangeForm extends PaymentMethodForm {
@Override @Override
public void addFormForDisplayAccount() { public void addFormForDisplayAccount() {
gridRowFrom = gridRow; 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); 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())); Res.get(clearXchangeAccount.getPaymentMethod().getId()));
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"),
clearXchangeAccount.getHolderName()); 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; clearXchangeAccount.getEmailOrMobileNr()).second;
field.setMouseTransparent(false); field.setMouseTransparent(false);
final TradeCurrency singleTradeCurrency = clearXchangeAccount.getSingleTradeCurrency(); final TradeCurrency singleTradeCurrency = clearXchangeAccount.getSingleTradeCurrency();
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"),
nameAndCode); nameAndCode);
addLimitations(); addLimitations();
} }

View File

@ -49,6 +49,7 @@ import javafx.util.StringConverter;
import java.util.Optional; import java.util.Optional;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon;
import static bisq.desktop.util.FormBuilder.addTopLabelTextField; import static bisq.desktop.util.FormBuilder.addTopLabelTextField;
import static bisq.desktop.util.GUIUtil.getComboBoxButtonCell; import static bisq.desktop.util.GUIUtil.getComboBoxButtonCell;
@ -127,15 +128,15 @@ public class CryptoCurrencyForm extends PaymentMethodForm {
gridRowFrom = gridRow; gridRowFrom = gridRow;
addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"),
cryptoCurrencyAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); 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())); Res.get(cryptoCurrencyAccount.getPaymentMethod().getId()));
Tuple3<Label, TextField, VBox> tuple2 = FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Tuple3<Label, TextField, VBox> tuple2 = addCompactTopLabelTextField(gridPane, ++gridRow,
Res.get("payment.altcoin.address"), cryptoCurrencyAccount.getAddress()); Res.get("payment.altcoin.address"), cryptoCurrencyAccount.getAddress());
TextField field = tuple2.second; TextField field = tuple2.second;
field.setMouseTransparent(false); field.setMouseTransparent(false);
final TradeCurrency singleTradeCurrency = cryptoCurrencyAccount.getSingleTradeCurrency(); final TradeCurrency singleTradeCurrency = cryptoCurrencyAccount.getSingleTradeCurrency();
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.altcoin"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.altcoin"),
nameAndCode); nameAndCode);
addLimitations(); addLimitations();
} }

View File

@ -47,9 +47,7 @@ import javafx.scene.control.ComboBox;
import javafx.scene.control.TextArea; import javafx.scene.control.TextArea;
import javafx.scene.layout.GridPane; import javafx.scene.layout.GridPane;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.FormBuilder.*;
import static bisq.desktop.util.FormBuilder.addTopLabelTextArea;
import static bisq.desktop.util.FormBuilder.addTopLabelTextField;
public class F2FForm extends PaymentMethodForm { public class F2FForm extends PaymentMethodForm {
private final F2FAccount f2fAccount; private final F2FAccount f2fAccount;
@ -154,18 +152,18 @@ public class F2FForm extends PaymentMethodForm {
addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"),
paymentAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); 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())); 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 : ""); getCountryBasedPaymentAccount().getCountry() != null ? getCountryBasedPaymentAccount().getCountry().name : "");
TradeCurrency singleTradeCurrency = paymentAccount.getSingleTradeCurrency(); TradeCurrency singleTradeCurrency = paymentAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.f2f.contact", f2fAccount.getContact()), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.f2f.contact", f2fAccount.getContact()),
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()); 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.setText(f2fAccount.getExtraInfo());
textArea.setPrefHeight(60); textArea.setPrefHeight(60);
textArea.setEditable(false); textArea.setEditable(false);

View File

@ -100,16 +100,16 @@ public class FasterPaymentsForm extends PaymentMethodForm {
gridRowFrom = gridRow; gridRowFrom = gridRow;
addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"),
fasterPaymentsAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); 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())); Res.get(fasterPaymentsAccount.getPaymentMethod().getId()));
// do not translate as it is used in english only // do not translate as it is used in english only
addTopLabelTextField(gridPane, ++gridRow, UK_SORT_CODE, fasterPaymentsAccount.getSortCode()); addCompactTopLabelTextField(gridPane, ++gridRow, UK_SORT_CODE, fasterPaymentsAccount.getSortCode());
TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.accountNr"), TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.accountNr"),
fasterPaymentsAccount.getAccountNr()).second; fasterPaymentsAccount.getAccountNr()).second;
field.setMouseTransparent(false); field.setMouseTransparent(false);
TradeCurrency singleTradeCurrency = fasterPaymentsAccount.getSingleTradeCurrency(); TradeCurrency singleTradeCurrency = fasterPaymentsAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations(); addLimitations();
} }

View File

@ -86,14 +86,14 @@ public class HalCashForm extends PaymentMethodForm {
gridRowFrom = gridRow; gridRowFrom = gridRow;
addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"),
halCashAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); 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())); 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; halCashAccount.getMobileNr()).second;
field.setMouseTransparent(false); field.setMouseTransparent(false);
TradeCurrency singleTradeCurrency = halCashAccount.getSingleTradeCurrency(); TradeCurrency singleTradeCurrency = halCashAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations(); addLimitations();
} }

View File

@ -113,19 +113,19 @@ public class InteracETransferForm extends PaymentMethodForm {
gridRowFrom = gridRow; gridRowFrom = gridRow;
addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"),
interacETransferAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); 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())); Res.get(interacETransferAccount.getPaymentMethod().getId()));
addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"),
interacETransferAccount.getHolderName()); interacETransferAccount.getHolderName());
addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"),
interacETransferAccount.getEmail()).second.setMouseTransparent(false); interacETransferAccount.getEmail()).second.setMouseTransparent(false);
addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.secret"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.secret"),
interacETransferAccount.getQuestion()).second.setMouseTransparent(false); interacETransferAccount.getQuestion()).second.setMouseTransparent(false);
addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.answer"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.answer"),
interacETransferAccount.getAnswer()).second.setMouseTransparent(false); interacETransferAccount.getAnswer()).second.setMouseTransparent(false);
TradeCurrency singleTradeCurrency = interacETransferAccount.getSingleTradeCurrency(); TradeCurrency singleTradeCurrency = interacETransferAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"),
nameAndCode); nameAndCode);
addLimitations(); addLimitations();
} }

View File

@ -35,6 +35,7 @@ import bisq.core.util.validation.InputValidator;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane; 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.addCompactTopLabelTextFieldWithCopyIcon;
import static bisq.desktop.util.FormBuilder.addTopLabelTextField; import static bisq.desktop.util.FormBuilder.addTopLabelTextField;
@ -67,7 +68,7 @@ public class MoneyBeamForm extends PaymentMethodForm {
final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency(); final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency();
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; 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(); addLimitations();
addAccountNameTextFieldWithAutoFillToggleButton(); addAccountNameTextFieldWithAutoFillToggleButton();
} }
@ -81,12 +82,12 @@ public class MoneyBeamForm extends PaymentMethodForm {
public void addFormForDisplayAccount() { public void addFormForDisplayAccount() {
gridRowFrom = gridRow; gridRowFrom = gridRow;
addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), account.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); 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())); addCompactTopLabelTextField(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; TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.moneyBeam.accountId"), account.getAccountId()).second;
field.setMouseTransparent(false); field.setMouseTransparent(false);
final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency(); final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency();
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; 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(); addLimitations();
} }

View File

@ -18,7 +18,6 @@
package bisq.desktop.components.paymentmethods; package bisq.desktop.components.paymentmethods;
import bisq.desktop.components.InputTextField; import bisq.desktop.components.InputTextField;
import bisq.desktop.util.FormBuilder;
import bisq.desktop.util.GUIUtil; import bisq.desktop.util.GUIUtil;
import bisq.desktop.util.Layout; import bisq.desktop.util.Layout;
import bisq.desktop.util.validation.EmailValidator; import bisq.desktop.util.validation.EmailValidator;
@ -46,9 +45,7 @@ import javafx.scene.layout.GridPane;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.FormBuilder.*;
import static bisq.desktop.util.FormBuilder.addInputTextField;
import static bisq.desktop.util.FormBuilder.addTopLabelFlowPane;
@Slf4j @Slf4j
public class MoneyGramForm extends PaymentMethodForm { public class MoneyGramForm extends PaymentMethodForm {
@ -88,16 +85,16 @@ public class MoneyGramForm extends PaymentMethodForm {
public void addFormForDisplayAccount() { public void addFormForDisplayAccount() {
gridRowFrom = gridRow; gridRowFrom = gridRow;
final Country country = getMoneyGramPaymentAccount().getCountry(); final Country country = getMoneyGramPaymentAccount().getCountry();
FormBuilder.addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), paymentAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); 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())); Res.get(paymentAccount.getPaymentMethod().getId()));
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.country"), country != null ? country.name : ""); addCompactTopLabelTextField(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.account.fullName"),
moneyGramAccountPayload.getHolderName()); moneyGramAccountPayload.getHolderName());
if (BankUtil.isStateRequired(moneyGramAccountPayload.getCountryCode())) 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); moneyGramAccountPayload.getState()).second.setMouseTransparent(false);
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"),
moneyGramAccountPayload.getEmail()); moneyGramAccountPayload.getEmail());
addLimitations(); addLimitations();
addCurrenciesGrid(false); addCurrenciesGrid(false);

View File

@ -280,12 +280,12 @@ public abstract class PaymentMethodForm {
TradeCurrency singleTradeCurrency) { TradeCurrency singleTradeCurrency) {
gridRowFrom = gridRow; gridRowFrom = gridRow;
addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), accountName, Layout.FIRST_ROW_AND_GROUP_DISTANCE); 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())); addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(paymentMethod.getId()));
TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.no"), accountNr).second; TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.no"), accountNr).second;
field.setMouseTransparent(false); field.setMouseTransparent(false);
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations(); addLimitations();
} }

View File

@ -92,14 +92,14 @@ public class PopmoneyForm extends PaymentMethodForm {
public void addFormForDisplayAccount() { public void addFormForDisplayAccount() {
gridRowFrom = gridRow; gridRowFrom = gridRow;
addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), account.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); 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())); addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(account.getPaymentMethod().getId()));
addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"),
account.getHolderName()); 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); field.setMouseTransparent(false);
final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency(); final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency();
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations(); addLimitations();
} }

View File

@ -86,14 +86,14 @@ public class PromptPayForm extends PaymentMethodForm {
gridRowFrom = gridRow; gridRowFrom = gridRow;
addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"),
promptPayAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); 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())); 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; promptPayAccount.getPromptPayId()).second;
field.setMouseTransparent(false); field.setMouseTransparent(false);
TradeCurrency singleTradeCurrency = promptPayAccount.getSingleTradeCurrency(); TradeCurrency singleTradeCurrency = promptPayAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations(); addLimitations();
} }

View File

@ -36,6 +36,7 @@ import javafx.scene.control.TextField;
import javafx.scene.layout.FlowPane; import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane; 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.addCompactTopLabelTextFieldWithCopyIcon;
import static bisq.desktop.util.FormBuilder.addTopLabelFlowPane; import static bisq.desktop.util.FormBuilder.addTopLabelFlowPane;
import static bisq.desktop.util.FormBuilder.addTopLabelTextField; import static bisq.desktop.util.FormBuilder.addTopLabelTextField;
@ -99,9 +100,9 @@ public class RevolutForm extends PaymentMethodForm {
gridRowFrom = gridRow; gridRowFrom = gridRow;
addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"),
account.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); 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())); 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; account.getAccountId()).second;
field.setMouseTransparent(false); field.setMouseTransparent(false);
addLimitations(); addLimitations();

View File

@ -46,7 +46,9 @@ import javafx.collections.FXCollections;
import java.util.List; import java.util.List;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon;
import static bisq.desktop.util.FormBuilder.addTopLabelTextField;
public class SepaForm extends GeneralSepaForm { public class SepaForm extends GeneralSepaForm {
@ -181,17 +183,17 @@ public class SepaForm extends GeneralSepaForm {
@Override @Override
public void addFormForDisplayAccount() { public void addFormForDisplayAccount() {
gridRowFrom = gridRow; gridRowFrom = gridRow;
FormBuilder.addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), sepaAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), sepaAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"),
Res.get(sepaAccount.getPaymentMethod().getId())); Res.get(sepaAccount.getPaymentMethod().getId()));
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), sepaAccount.getHolderName()); addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), sepaAccount.getHolderName());
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, IBAN, sepaAccount.getIban()).second.setMouseTransparent(false); addCompactTopLabelTextField(gridPane, ++gridRow, IBAN, sepaAccount.getIban()).second.setMouseTransparent(false);
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, BIC, sepaAccount.getBic()).second.setMouseTransparent(false); addCompactTopLabelTextField(gridPane, ++gridRow, BIC, sepaAccount.getBic()).second.setMouseTransparent(false);
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.bank.country"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.bank.country"),
sepaAccount.getCountry() != null ? sepaAccount.getCountry().name : ""); sepaAccount.getCountry() != null ? sepaAccount.getCountry().name : "");
TradeCurrency singleTradeCurrency = sepaAccount.getSingleTradeCurrency(); TradeCurrency singleTradeCurrency = sepaAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; 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; String countries;
Tooltip tooltip = null; Tooltip tooltip = null;
if (CountryUtil.containsAllSepaEuroCountries(sepaAccount.getAcceptedCountryCodes())) { if (CountryUtil.containsAllSepaEuroCountries(sepaAccount.getAcceptedCountryCodes())) {
@ -200,7 +202,7 @@ public class SepaForm extends GeneralSepaForm {
countries = CountryUtil.getCodesString(sepaAccount.getAcceptedCountryCodes()); countries = CountryUtil.getCodesString(sepaAccount.getAcceptedCountryCodes());
tooltip = new Tooltip(CountryUtil.getNamesByCodesString(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) { if (tooltip != null) {
acceptedCountries.setMouseTransparent(false); acceptedCountries.setMouseTransparent(false);
acceptedCountries.setTooltip(tooltip); acceptedCountries.setTooltip(tooltip);

View File

@ -46,7 +46,9 @@ import javafx.collections.FXCollections;
import java.util.List; import java.util.List;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextField;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon;
import static bisq.desktop.util.FormBuilder.addTopLabelTextField;
public class SepaInstantForm extends GeneralSepaForm { public class SepaInstantForm extends GeneralSepaForm {
@ -180,17 +182,17 @@ public class SepaInstantForm extends GeneralSepaForm {
@Override @Override
public void addFormForDisplayAccount() { public void addFormForDisplayAccount() {
gridRowFrom = gridRow; gridRowFrom = gridRow;
FormBuilder.addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), sepaInstantAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), sepaInstantAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"),
Res.get(sepaInstantAccount.getPaymentMethod().getId())); Res.get(sepaInstantAccount.getPaymentMethod().getId()));
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), sepaInstantAccount.getHolderName()); addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), sepaInstantAccount.getHolderName());
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, IBAN, sepaInstantAccount.getIban()).second.setMouseTransparent(false); addCompactTopLabelTextField(gridPane, ++gridRow, IBAN, sepaInstantAccount.getIban()).second.setMouseTransparent(false);
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, BIC, sepaInstantAccount.getBic()).second.setMouseTransparent(false); addCompactTopLabelTextField(gridPane, ++gridRow, BIC, sepaInstantAccount.getBic()).second.setMouseTransparent(false);
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.bank.country"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.bank.country"),
sepaInstantAccount.getCountry() != null ? sepaInstantAccount.getCountry().name : ""); sepaInstantAccount.getCountry() != null ? sepaInstantAccount.getCountry().name : "");
TradeCurrency singleTradeCurrency = sepaInstantAccount.getSingleTradeCurrency(); TradeCurrency singleTradeCurrency = sepaInstantAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; 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; String countries;
Tooltip tooltip = null; Tooltip tooltip = null;
if (CountryUtil.containsAllSepaInstantEuroCountries(sepaInstantAccount.getAcceptedCountryCodes())) { if (CountryUtil.containsAllSepaInstantEuroCountries(sepaInstantAccount.getAcceptedCountryCodes())) {
@ -199,7 +201,7 @@ public class SepaInstantForm extends GeneralSepaForm {
countries = CountryUtil.getCodesString(sepaInstantAccount.getAcceptedCountryCodes()); countries = CountryUtil.getCodesString(sepaInstantAccount.getAcceptedCountryCodes());
tooltip = new Tooltip(CountryUtil.getNamesByCodesString(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) { if (tooltip != null) {
acceptedCountries.setMouseTransparent(false); acceptedCountries.setMouseTransparent(false);
acceptedCountries.setTooltip(tooltip); acceptedCountries.setTooltip(tooltip);

View File

@ -101,16 +101,16 @@ public class SwishForm extends PaymentMethodForm {
gridRowFrom = gridRow; gridRowFrom = gridRow;
addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"),
swishAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); 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())); Res.get(swishAccount.getPaymentMethod().getId()));
addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"),
swishAccount.getHolderName()); swishAccount.getHolderName());
TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.mobile"), TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.mobile"),
swishAccount.getMobileNr()).second; swishAccount.getMobileNr()).second;
field.setMouseTransparent(false); field.setMouseTransparent(false);
TradeCurrency singleTradeCurrency = swishAccount.getSingleTradeCurrency(); TradeCurrency singleTradeCurrency = swishAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations(); addLimitations();
} }

View File

@ -35,9 +35,7 @@ import bisq.core.util.validation.InputValidator;
import javafx.scene.control.TextArea; import javafx.scene.control.TextArea;
import javafx.scene.layout.GridPane; import javafx.scene.layout.GridPane;
import static bisq.desktop.util.FormBuilder.addCompactTopLabelTextFieldWithCopyIcon; import static bisq.desktop.util.FormBuilder.*;
import static bisq.desktop.util.FormBuilder.addTopLabelTextArea;
import static bisq.desktop.util.FormBuilder.addTopLabelTextField;
public class USPostalMoneyOrderForm extends PaymentMethodForm { public class USPostalMoneyOrderForm extends PaymentMethodForm {
private final USPostalMoneyOrderAccount usPostalMoneyOrderAccount; private final USPostalMoneyOrderAccount usPostalMoneyOrderAccount;
@ -88,7 +86,7 @@ public class USPostalMoneyOrderForm extends PaymentMethodForm {
TradeCurrency singleTradeCurrency = usPostalMoneyOrderAccount.getSingleTradeCurrency(); TradeCurrency singleTradeCurrency = usPostalMoneyOrderAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"),
nameAndCode); nameAndCode);
addLimitations(); addLimitations();
addAccountNameTextFieldWithAutoFillToggleButton(); addAccountNameTextFieldWithAutoFillToggleButton();
@ -104,17 +102,17 @@ public class USPostalMoneyOrderForm extends PaymentMethodForm {
gridRowFrom = gridRow; gridRowFrom = gridRow;
addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"),
usPostalMoneyOrderAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); 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())); Res.get(usPostalMoneyOrderAccount.getPaymentMethod().getId()));
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"),
usPostalMoneyOrderAccount.getHolderName()); 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.setText(usPostalMoneyOrderAccount.getPostalAddress());
textArea.setPrefHeight(60); textArea.setPrefHeight(60);
textArea.setEditable(false); textArea.setEditable(false);
TradeCurrency singleTradeCurrency = usPostalMoneyOrderAccount.getSingleTradeCurrency(); TradeCurrency singleTradeCurrency = usPostalMoneyOrderAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; 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(); addLimitations();
} }

View File

@ -36,6 +36,7 @@ import javafx.scene.control.TextField;
import javafx.scene.layout.FlowPane; import javafx.scene.layout.FlowPane;
import javafx.scene.layout.GridPane; 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.addCompactTopLabelTextFieldWithCopyIcon;
import static bisq.desktop.util.FormBuilder.addTopLabelTextField; import static bisq.desktop.util.FormBuilder.addTopLabelTextField;
@ -99,9 +100,9 @@ public class UpholdForm extends PaymentMethodForm {
gridRowFrom = gridRow; gridRowFrom = gridRow;
addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"),
upholdAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); 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())); 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; upholdAccount.getAccountId()).second;
field.setMouseTransparent(false); field.setMouseTransparent(false);
addLimitations(); addLimitations();

View File

@ -37,6 +37,7 @@ import org.apache.commons.lang3.StringUtils;
import javafx.scene.control.TextField; import javafx.scene.control.TextField;
import javafx.scene.layout.GridPane; 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.addCompactTopLabelTextFieldWithCopyIcon;
import static bisq.desktop.util.FormBuilder.addTopLabelTextField; import static bisq.desktop.util.FormBuilder.addTopLabelTextField;
@ -100,14 +101,14 @@ public class VenmoForm extends PaymentMethodForm {
public void addFormForDisplayAccount() { public void addFormForDisplayAccount() {
gridRowFrom = gridRow; gridRowFrom = gridRow;
addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), account.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); 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())); addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"), Res.get(account.getPaymentMethod().getId()));
addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.owner"),
account.getHolderName()); 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); field.setMouseTransparent(false);
final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency(); final TradeCurrency singleTradeCurrency = account.getSingleTradeCurrency();
final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : ""; final String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode); addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations(); addLimitations();
} }

View File

@ -46,7 +46,9 @@ import javafx.scene.layout.GridPane;
import lombok.extern.slf4j.Slf4j; 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.addCompactTopLabelTextFieldWithCopyIcon;
import static bisq.desktop.util.FormBuilder.addTopLabelTextField;
@Slf4j @Slf4j
public class WesternUnionForm extends PaymentMethodForm { public class WesternUnionForm extends PaymentMethodForm {
@ -85,23 +87,23 @@ public class WesternUnionForm extends PaymentMethodForm {
public void addFormForDisplayAccount() { public void addFormForDisplayAccount() {
gridRowFrom = gridRow; gridRowFrom = gridRow;
FormBuilder.addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"), paymentAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE); 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())); 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 : ""); getCountryBasedPaymentAccount().getCountry() != null ? getCountryBasedPaymentAccount().getCountry().name : "");
TradeCurrency singleTradeCurrency = paymentAccount.getSingleTradeCurrency(); TradeCurrency singleTradeCurrency = paymentAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"),
nameAndCode); nameAndCode);
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.fullName"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.fullName"),
westernUnionAccountPayload.getHolderName()); westernUnionAccountPayload.getHolderName());
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.city"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.account.city"),
westernUnionAccountPayload.getCity()).second.setMouseTransparent(false); westernUnionAccountPayload.getCity()).second.setMouseTransparent(false);
if (BankUtil.isStateRequired(westernUnionAccountPayload.getCountryCode())) 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); westernUnionAccountPayload.getState()).second.setMouseTransparent(false);
FormBuilder.addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"), addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.email"),
westernUnionAccountPayload.getEmail()); westernUnionAccountPayload.getEmail());
addLimitations(); addLimitations();
} }

View File

@ -295,10 +295,6 @@
-fx-image: url("../../images/btcaverage.png"); -fx-image: url("../../images/btcaverage.png");
} }
#spinner {
-fx-image: url("../../images/spinner.png");
}
#accepted { #accepted {
-fx-image: url("../../images/accepted.png"); -fx-image: url("../../images/accepted.png");
} }

View File

@ -78,8 +78,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
import static bisq.desktop.util.FormBuilder.addButton; import static bisq.desktop.util.FormBuilder.*;
import static bisq.desktop.util.FormBuilder.addSlideToggleButton;
@FxmlView @FxmlView
public class MobileNotificationsView extends ActivatableView<GridPane, Void> { public class MobileNotificationsView extends ActivatableView<GridPane, Void> {
@ -289,6 +288,7 @@ public class MobileNotificationsView extends ActivatableView<GridPane, Void> {
} }
} }
//TODO: never used --> Do we really want to keep it here if we need it?
private void onSendTestMsg() { private void onSendTestMsg() {
MobileMessage message = null; MobileMessage message = null;
List<MobileMessage> messages = null; List<MobileMessage> messages = null;
@ -393,23 +393,21 @@ public class MobileNotificationsView extends ActivatableView<GridPane, Void> {
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
private void createSetupFields() { 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, downloadButton = addButton(root, gridRow,
Res.get("account.notifications.download.label"), Res.get("account.notifications.download.label"),
Layout.FIRST_ROW_DISTANCE); Layout.TWICE_FIRST_ROW_DISTANCE);
Tuple3<Label, Button, Button> tuple = FormBuilder.addTopLabel2Buttons(root, ++gridRow, Tuple3<Label, Button, Button> tuple = addTopLabel2Buttons(root, ++gridRow,
Res.get("account.notifications.webcam.label"), Res.get("account.notifications.webcam.label"),
Res.get("account.notifications.webcam.button"), Res.get("account.notifications.noWebcam.button"), 0); Res.get("account.notifications.webcam.button"), Res.get("account.notifications.noWebcam.button"), 0);
webCamButton = tuple.second; webCamButton = tuple.second;
noWebCamButton = tuple.third; noWebCamButton = tuple.third;
tokenInputTextField = FormBuilder.addInputTextField(root, ++gridRow, tokenInputTextField = addInputTextField(root, ++gridRow,
Res.get("account.notifications.email.label")); Res.get("account.notifications.email.label"));
tokenInputTextField.setPromptText(Res.get("account.notifications.email.prompt")); tokenInputTextField.setPromptText(Res.get("account.notifications.email.prompt"));
tokenInputTextFieldListener = (observable, oldValue, newValue) -> { tokenInputTextFieldListener = (observable, oldValue, newValue) -> applyKeyAndToken(newValue);
applyKeyAndToken(newValue);
};
tokenInputTextField.setManaged(false); tokenInputTextField.setManaged(false);
tokenInputTextField.setVisible(false); tokenInputTextField.setVisible(false);
@ -417,14 +415,14 @@ public class MobileNotificationsView extends ActivatableView<GridPane, Void> {
Res.get("account.notifications.testMsg.title")).second; Res.get("account.notifications.testMsg.title")).second;
testMsgButton.setDefaultButton(false);*/ testMsgButton.setDefaultButton(false);*/
eraseButton = FormBuilder.addTopLabelButton(root, ++gridRow, eraseButton = addTopLabelButton(root, ++gridRow,
Res.get("account.notifications.erase.label"), Res.get("account.notifications.erase.label"),
Res.get("account.notifications.erase.title")).second; Res.get("account.notifications.erase.title")).second;
eraseButton.setId("notification-erase-button"); eraseButton.setId("notification-erase-button");
} }
private void createSettingsFields() { private void createSettingsFields() {
FormBuilder.addTitledGroupBg(root, ++gridRow, 4, addTitledGroupBg(root, ++gridRow, 4,
Res.get("account.notifications.settings.title"), Res.get("account.notifications.settings.title"),
Layout.GROUP_DISTANCE); Layout.GROUP_DISTANCE);
@ -464,9 +462,9 @@ public class MobileNotificationsView extends ActivatableView<GridPane, Void> {
} }
private void createMarketAlertFields() { 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); Layout.GROUP_DISTANCE);
paymentAccountsComboBox = FormBuilder.<PaymentAccount>addComboBox(root, gridRow, paymentAccountsComboBox = FormBuilder.addComboBox(root, gridRow,
Res.get("account.notifications.marketAlert.selectPaymentAccount"), Res.get("account.notifications.marketAlert.selectPaymentAccount"),
Layout.FIRST_ROW_AND_GROUP_DISTANCE); Layout.FIRST_ROW_AND_GROUP_DISTANCE);
paymentAccountsComboBox.setConverter(new StringConverter<>() { paymentAccountsComboBox.setConverter(new StringConverter<>() {
@ -503,9 +501,7 @@ public class MobileNotificationsView extends ActivatableView<GridPane, Void> {
infoInputTextField.setContentForInfoPopOver(createMarketAlertPriceInfoPopupLabel(Res.get("account.notifications.marketAlert.trigger.info"))); infoInputTextField.setContentForInfoPopOver(createMarketAlertPriceInfoPopupLabel(Res.get("account.notifications.marketAlert.trigger.info")));
infoInputTextField.setIconsRightAligned(); infoInputTextField.setIconsRightAligned();
marketAlertTriggerListener = (observable, oldValue, newValue) -> { marketAlertTriggerListener = (observable, oldValue, newValue) -> updateMarketAlertFields();
updateMarketAlertFields();
};
marketAlertTriggerFocusListener = (observable, oldValue, newValue) -> { marketAlertTriggerFocusListener = (observable, oldValue, newValue) -> {
if (oldValue && !newValue) { if (oldValue && !newValue) {
try { try {
@ -526,12 +522,12 @@ public class MobileNotificationsView extends ActivatableView<GridPane, Void> {
} }
private void createPriceAlertFields() { private void createPriceAlertFields() {
FormBuilder.addTitledGroupBg(root, ++gridRow, 4, addTitledGroupBg(root, ++gridRow, 4,
Res.get("account.notifications.priceAlert.title"), 20); Res.get("account.notifications.priceAlert.title"), 20);
currencyComboBox = FormBuilder.<TradeCurrency>addComboBox(root, gridRow, currencyComboBox = FormBuilder.addComboBox(root, gridRow,
Res.getWithCol("list.currency.select"), 40); Res.getWithCol("list.currency.select"), 40);
currencyComboBox.setPromptText(Res.get("list.currency.select")); currencyComboBox.setPromptText(Res.get("list.currency.select"));
currencyComboBox.setConverter(new StringConverter<TradeCurrency>() { currencyComboBox.setConverter(new StringConverter<>() {
@Override @Override
public String toString(TradeCurrency currency) { public String toString(TradeCurrency currency) {
return currency.getNameAndCode(); return currency.getNameAndCode();
@ -543,7 +539,7 @@ public class MobileNotificationsView extends ActivatableView<GridPane, Void> {
} }
}); });
priceAlertHighInputTextField = FormBuilder.addInputTextField(root, ++gridRow, priceAlertHighInputTextField = addInputTextField(root, ++gridRow,
Res.getWithCol("account.notifications.priceAlert.high.label")); Res.getWithCol("account.notifications.priceAlert.high.label"));
priceAlertHighListener = (observable, oldValue, newValue) -> { priceAlertHighListener = (observable, oldValue, newValue) -> {
long priceAlertHighTextFieldValue = getPriceAsLong(priceAlertHighInputTextField); long priceAlertHighTextFieldValue = getPriceAsLong(priceAlertHighInputTextField);
@ -569,7 +565,7 @@ public class MobileNotificationsView extends ActivatableView<GridPane, Void> {
} }
} }
}; };
priceAlertLowInputTextField = FormBuilder.addInputTextField(root, ++gridRow, priceAlertLowInputTextField = addInputTextField(root, ++gridRow,
Res.getWithCol("account.notifications.priceAlert.low.label")); Res.getWithCol("account.notifications.priceAlert.low.label"));
priceAlertLowListener = (observable, oldValue, newValue) -> { priceAlertLowListener = (observable, oldValue, newValue) -> {
long priceAlertHighTextFieldValue = getPriceAsLong(priceAlertHighInputTextField); long priceAlertHighTextFieldValue = getPriceAsLong(priceAlertHighInputTextField);
@ -605,12 +601,10 @@ public class MobileNotificationsView extends ActivatableView<GridPane, Void> {
// fillPriceAlertFields method. To be sure that we called after the PriceAlertFilter has been removed we delay // 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 // to the next frame. The priceFeedServiceListener in the mobileNotificationService might get called before
// our listener here. // our listener here.
priceFeedServiceListener = (observable, oldValue, newValue) -> { priceFeedServiceListener = (observable, oldValue, newValue) -> UserThread.execute(() -> {
UserThread.execute(() -> { fillPriceAlertFields();
fillPriceAlertFields(); updatePriceAlertFields();
updatePriceAlertFields(); });
});
};
} }

View File

@ -28,7 +28,6 @@ import bisq.desktop.main.MainView;
import bisq.desktop.main.account.AccountView; import bisq.desktop.main.account.AccountView;
import bisq.desktop.main.account.content.seedwords.SeedWordsView; import bisq.desktop.main.account.content.seedwords.SeedWordsView;
import bisq.desktop.main.overlays.popups.Popup; import bisq.desktop.main.overlays.popups.Popup;
import bisq.desktop.util.FormBuilder;
import bisq.desktop.util.Layout; import bisq.desktop.util.Layout;
import bisq.desktop.util.validation.PasswordValidator; import bisq.desktop.util.validation.PasswordValidator;
@ -52,7 +51,9 @@ import javafx.scene.layout.HBox;
import javafx.beans.value.ChangeListener; import javafx.beans.value.ChangeListener;
import static bisq.desktop.util.FormBuilder.addButtonBusyAnimationLabel; 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.addPasswordTextField;
import static bisq.desktop.util.FormBuilder.addTitledGroupBg;
import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkArgument;
@FxmlView @FxmlView
@ -67,7 +68,8 @@ public class PasswordView extends ActivatableView<GridPane, Void> {
private AutoTooltipButton pwButton; private AutoTooltipButton pwButton;
private TitledGroupBg headline; private TitledGroupBg headline;
private int gridRow = 0; private int gridRow = 0;
private ChangeListener<Boolean> passwordFieldChangeListener; private ChangeListener<Boolean> passwordFieldFocusChangeListener;
private ChangeListener<String> passwordFieldTextChangeListener;
private ChangeListener<String> repeatedPasswordFieldChangeListener; private ChangeListener<String> repeatedPasswordFieldChangeListener;
@ -84,16 +86,20 @@ public class PasswordView extends ActivatableView<GridPane, Void> {
@Override @Override
public void initialize() { public void initialize() {
headline = FormBuilder.addTitledGroupBg(root, gridRow, 3, ""); headline = addTitledGroupBg(root, gridRow, 3, "");
passwordField = addPasswordTextField(root, gridRow, Res.get("password.enterPassword"), Layout.FIRST_ROW_DISTANCE); passwordField = addPasswordTextField(root, gridRow, Res.get("password.enterPassword"), Layout.TWICE_FIRST_ROW_DISTANCE);
final RequiredFieldValidator requiredFieldValidator = new RequiredFieldValidator(); final RequiredFieldValidator requiredFieldValidator = new RequiredFieldValidator();
passwordField.getValidators().addAll(requiredFieldValidator, passwordValidator); passwordField.getValidators().addAll(requiredFieldValidator, passwordValidator);
passwordFieldChangeListener = (observable, oldValue, newValue) -> { passwordFieldFocusChangeListener = (observable, oldValue, newValue) -> {
if (!newValue) validatePasswords(); if (!newValue) validatePasswords();
}; };
passwordFieldTextChangeListener = (observable, oldvalue, newValue) -> {
if (oldvalue != newValue) validatePasswords();
};
repeatedPasswordField = addPasswordTextField(root, ++gridRow, Res.get("password.confirmPassword")); 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); repeatedPasswordField.getValidators().addAll(requiredFieldValidator, passwordValidator);
repeatedPasswordFieldChangeListener = (observable, oldValue, newValue) -> { repeatedPasswordFieldChangeListener = (observable, oldValue, newValue) -> {
if (oldValue != newValue) validatePasswords(); if (oldValue != newValue) validatePasswords();
@ -123,8 +129,8 @@ public class PasswordView extends ActivatableView<GridPane, Void> {
} }
}); });
FormBuilder.addTitledGroupBg(root, ++gridRow, 1, Res.get("shared.information"), Layout.GROUP_DISTANCE); 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); addMultilineLabel(root, gridRow, Res.get("account.password.info"), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
} }
private void onApplyPassword(BusyAnimation busyAnimation, Label deriveStatusLabel) { private void onApplyPassword(BusyAnimation busyAnimation, Label deriveStatusLabel) {
@ -146,9 +152,7 @@ public class PasswordView extends ActivatableView<GridPane, Void> {
new Popup<>() new Popup<>()
.feedback(Res.get("password.walletDecrypted")) .feedback(Res.get("password.walletDecrypted"))
.show(); .show();
passwordField.clear(); backupWalletAndResetFields();
repeatedPasswordField.clear();
walletsManager.backupWallets();
} else { } else {
pwButton.setDisable(false); pwButton.setDisable(false);
new Popup<>() new Popup<>()
@ -161,10 +165,8 @@ public class PasswordView extends ActivatableView<GridPane, Void> {
new Popup<>() new Popup<>()
.feedback(Res.get("password.walletEncrypted")) .feedback(Res.get("password.walletEncrypted"))
.show(); .show();
passwordField.clear(); backupWalletAndResetFields();
repeatedPasswordField.clear();
walletsManager.clearBackup(); walletsManager.clearBackup();
walletsManager.backupWallets();
} catch (Throwable t) { } catch (Throwable t) {
new Popup<>() new Popup<>()
.warning(Res.get("password.walletEncryptionFailed")) .warning(Res.get("password.walletEncryptionFailed"))
@ -172,18 +174,27 @@ public class PasswordView extends ActivatableView<GridPane, Void> {
} }
} }
setText(); setText();
updatePasswordListeners();
}); });
} }
private void backupWalletAndResetFields() {
passwordField.clear();
repeatedPasswordField.clear();
walletsManager.backupWallets();
}
private void setText() { private void setText() {
if (walletsManager.areWalletsEncrypted()) { if (walletsManager.areWalletsEncrypted()) {
pwButton.updateText(Res.get("account.password.removePw.button")); pwButton.updateText(Res.get("account.password.removePw.button"));
headline.setText(Res.get("account.password.removePw.headline")); headline.setText(Res.get("account.password.removePw.headline"));
repeatedPasswordField.setVisible(false); repeatedPasswordField.setVisible(false);
repeatedPasswordField.setManaged(false); repeatedPasswordField.setManaged(false);
} else { } else {
pwButton.updateText(Res.get("account.password.setPw.button")); pwButton.updateText(Res.get("account.password.setPw.button"));
headline.setText(Res.get("account.password.setPw.headline")); headline.setText(Res.get("account.password.setPw.headline"));
repeatedPasswordField.setVisible(true); repeatedPasswordField.setVisible(true);
repeatedPasswordField.setManaged(true); repeatedPasswordField.setManaged(true);
} }
@ -191,14 +202,26 @@ public class PasswordView extends ActivatableView<GridPane, Void> {
@Override @Override
protected void activate() { protected void activate() {
passwordField.focusedProperty().addListener(passwordFieldChangeListener); updatePasswordListeners();
repeatedPasswordField.textProperty().addListener(repeatedPasswordFieldChangeListener);
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 @Override
protected void deactivate() { protected void deactivate() {
passwordField.focusedProperty().removeListener(passwordFieldChangeListener); passwordField.focusedProperty().removeListener(passwordFieldFocusChangeListener);
passwordField.textProperty().removeListener(passwordFieldTextChangeListener);
repeatedPasswordField.textProperty().removeListener(repeatedPasswordFieldChangeListener); repeatedPasswordField.textProperty().removeListener(repeatedPasswordFieldChangeListener);
} }

View File

@ -117,7 +117,7 @@ public class SeedWordsView extends ActivatableView<GridPane, Void> {
seedWordsTextArea.setMaxHeight(40); seedWordsTextArea.setMaxHeight(40);
restoreDatePicker = addTopLabelDatePicker(root, ++gridRow, Res.get("seed.date"), 10).second; 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); addTitledGroupBg(root, ++gridRow, 1, Res.get("shared.information"), Layout.GROUP_DISTANCE);
addMultilineLabel(root, gridRow, Res.get("account.seed.info"), addMultilineLabel(root, gridRow, Res.get("account.seed.info"),

View File

@ -26,7 +26,7 @@
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"
xmlns:fx="http://javafx.com/fxml"> xmlns:fx="http://javafx.com/fxml">
<padding> <padding>
<Insets bottom="10.0" left="25.0" top="20.0" right="25"/> <Insets bottom="10.0" left="10.0" top="10.0" right="10"/>
</padding> </padding>
</GridPane> </GridPane>

View File

@ -39,8 +39,6 @@ import javafx.scene.control.TableView;
import javafx.scene.layout.GridPane; import javafx.scene.layout.GridPane;
import javafx.scene.layout.Priority; import javafx.scene.layout.Priority;
import javafx.geometry.Insets;
import javafx.beans.property.ReadOnlyObjectWrapper; import javafx.beans.property.ReadOnlyObjectWrapper;
import javafx.collections.ListChangeListener; import javafx.collections.ListChangeListener;
@ -73,7 +71,6 @@ public class SpreadView extends ActivatableViewAndModel<GridPane, SpreadViewMode
public void initialize() { public void initialize() {
tableView = new TableView<>(); tableView = new TableView<>();
GridPane.setRowIndex(tableView, gridRow); GridPane.setRowIndex(tableView, gridRow);
GridPane.setMargin(tableView, new Insets(-10, -15, -10, -15));
GridPane.setVgrow(tableView, Priority.ALWAYS); GridPane.setVgrow(tableView, Priority.ALWAYS);
GridPane.setHgrow(tableView, Priority.ALWAYS); GridPane.setHgrow(tableView, Priority.ALWAYS);
root.getChildren().add(tableView); root.getChildren().add(tableView);

View File

@ -21,7 +21,7 @@
<?import javafx.scene.layout.VBox?> <?import javafx.scene.layout.VBox?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.Insets?>
<VBox fx:id="root" fx:controller="bisq.desktop.main.market.trades.TradesChartsView" <VBox fx:id="root" fx:controller="bisq.desktop.main.market.trades.TradesChartsView"
spacing="10.0" fillWidth="true" spacing="7.0" fillWidth="true"
AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0"
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"
xmlns:fx="http://javafx.com/fxml"> xmlns:fx="http://javafx.com/fxml">

View File

@ -132,6 +132,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
private ScrollPane scrollPane; private ScrollPane scrollPane;
protected GridPane gridPane; protected GridPane gridPane;
private TitledGroupBg payFundsTitledGroupBg, setDepositTitledGroupBg, paymentTitledGroupBg; private TitledGroupBg payFundsTitledGroupBg, setDepositTitledGroupBg, paymentTitledGroupBg;
protected TitledGroupBg amountTitledGroupBg;
private BusyAnimation waitingForFundsSpinner; private BusyAnimation waitingForFundsSpinner;
private AutoTooltipButton nextButton, cancelButton1, cancelButton2, placeOfferButton; private AutoTooltipButton nextButton, cancelButton1, cancelButton2, placeOfferButton;
private Button priceTypeToggleButton; private Button priceTypeToggleButton;
@ -141,18 +142,22 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
private AddressTextField addressTextField; private AddressTextField addressTextField;
private BalanceTextField balanceTextField; private BalanceTextField balanceTextField;
private FundsTextField totalToPayTextField; private FundsTextField totalToPayTextField;
private Label amountDescriptionLabel, private Label amountDescriptionLabel;
priceCurrencyLabel, priceDescriptionLabel, private Label priceCurrencyLabel;
volumeDescriptionLabel, private Label priceDescriptionLabel;
waitingForFundsLabel, marketBasedPriceLabel, percentagePriceDescription, private Label volumeDescriptionLabel;
buyerSecurityDepositBtcLabel, tradeFeeDescriptionLabel, resultLabel, private Label waitingForFundsLabel;
tradeFeeInBtcLabel, tradeFeeInBsqLabel; private Label marketBasedPriceLabel;
private Label percentagePriceDescription;
private Label tradeFeeDescriptionLabel;
private Label resultLabel;
private Label tradeFeeInBtcLabel;
private Label tradeFeeInBsqLabel;
protected Label amountBtcLabel, volumeCurrencyLabel, minAmountBtcLabel; protected Label amountBtcLabel, volumeCurrencyLabel, minAmountBtcLabel;
private ComboBox<PaymentAccount> paymentAccountsComboBox; private ComboBox<PaymentAccount> paymentAccountsComboBox;
private ComboBox<TradeCurrency> currencyComboBox; private ComboBox<TradeCurrency> currencyComboBox;
private VBox currencySelection;
private ImageView qrCodeImageView; private ImageView qrCodeImageView;
private VBox fixedPriceBox, percentagePriceBox, private VBox currencySelection, fixedPriceBox, percentagePriceBox,
currencyTextFieldBox; currencyTextFieldBox;
private HBox fundingHBox, firstRowHBox, secondRowHBox, placeOfferBox, amountValueCurrencyBox, private HBox fundingHBox, firstRowHBox, secondRowHBox, placeOfferBox, amountValueCurrencyBox,
priceAsPercentageValueCurrencyBox, volumeValueCurrencyBox, priceValueCurrencyBox, priceAsPercentageValueCurrencyBox, volumeValueCurrencyBox, priceValueCurrencyBox,
@ -161,7 +166,8 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
private Subscription isWaitingForFundsSubscription, balanceSubscription, cancelButton2StyleSubscription; private Subscription isWaitingForFundsSubscription, balanceSubscription, cancelButton2StyleSubscription;
private ChangeListener<Boolean> amountFocusedListener, minAmountFocusedListener, volumeFocusedListener, private ChangeListener<Boolean> amountFocusedListener, minAmountFocusedListener, volumeFocusedListener,
buyerSecurityDepositFocusedListener, priceFocusedListener, placeOfferCompletedListener, buyerSecurityDepositFocusedListener, priceFocusedListener, placeOfferCompletedListener,
priceAsPercentageFocusedListener; priceAsPercentageFocusedListener, getShowWalletFundedNotificationListener,
tradeFeeInBtcToggleListener, tradeFeeInBsqToggleListener, tradeFeeVisibleListener;
private ChangeListener<String> tradeCurrencyCodeListener, errorMessageListener, private ChangeListener<String> tradeCurrencyCodeListener, errorMessageListener,
marketPriceMarginListener, volumeListener; marketPriceMarginListener, volumeListener;
private ChangeListener<Number> marketPriceAvailableListener; private ChangeListener<Number> marketPriceAvailableListener;
@ -171,11 +177,8 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
protected int gridRow = 0; protected int gridRow = 0;
private final List<Node> editOfferElements = new ArrayList<>(); private final List<Node> editOfferElements = new ArrayList<>();
private boolean clearXchangeWarningDisplayed, isActivated; private boolean clearXchangeWarningDisplayed, isActivated;
private ChangeListener<Boolean> getShowWalletFundedNotificationListener;
private InfoInputTextField marketBasedPriceInfoInputTextField, volumeInfoInputTextField; private InfoInputTextField marketBasedPriceInfoInputTextField, volumeInfoInputTextField;
protected TitledGroupBg amountTitledGroupBg;
private AutoTooltipSlideToggleButton tradeFeeInBtcToggle, tradeFeeInBsqToggle; private AutoTooltipSlideToggleButton tradeFeeInBtcToggle, tradeFeeInBsqToggle;
private ChangeListener<Boolean> tradeFeeInBtcToggleListener, tradeFeeInBsqToggleListener;
private Text xIcon, fakeXIcon; private Text xIcon, fakeXIcon;
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
@ -478,6 +481,8 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
} }
private void updateOfferElementsStyle() { private void updateOfferElementsStyle() {
GridPane.setColumnSpan(firstRowHBox, 1);
final String activeInputStyle = "input-with-border"; final String activeInputStyle = "input-with-border";
final String readOnlyInputStyle = "input-with-border-readonly"; final String readOnlyInputStyle = "input-with-border-readonly";
amountValueCurrencyBox.getStyleClass().remove(activeInputStyle); amountValueCurrencyBox.getStyleClass().remove(activeInputStyle);
@ -510,8 +515,6 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
// unwanted selection events (item 0) // unwanted selection events (item 0)
currencyComboBox.setOnAction(null); currencyComboBox.setOnAction(null);
resetValidationOfInputFields();
PaymentAccount paymentAccount = paymentAccountsComboBox.getSelectionModel().getSelectedItem(); PaymentAccount paymentAccount = paymentAccountsComboBox.getSelectionModel().getSelectedItem();
if (paymentAccount != null) { if (paymentAccount != null) {
maybeShowClearXchangeWarning(paymentAccount); maybeShowClearXchangeWarning(paymentAccount);
@ -550,19 +553,6 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
updatePriceToggle(); 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() { private void onCurrencyComboBoxSelected() {
model.onCurrencySelected(currencyComboBox.getSelectionModel().getSelectedItem()); model.onCurrencySelected(currencyComboBox.getSelectionModel().getSelectedItem());
} }
@ -599,6 +589,9 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
tradeFeeInBtcLabel.textProperty().bind(model.tradeFeeInBtcWithFiat); tradeFeeInBtcLabel.textProperty().bind(model.tradeFeeInBtcWithFiat);
tradeFeeInBsqLabel.textProperty().bind(model.tradeFeeInBsqWithFiat); tradeFeeInBsqLabel.textProperty().bind(model.tradeFeeInBsqWithFiat);
tradeFeeDescriptionLabel.textProperty().bind(model.tradeFeeDescription); tradeFeeDescriptionLabel.textProperty().bind(model.tradeFeeDescription);
tradeFeeInBtcLabel.visibleProperty().bind(model.isTradeFeeVisible);
tradeFeeInBsqLabel.visibleProperty().bind(model.isTradeFeeVisible);
tradeFeeDescriptionLabel.visibleProperty().bind(model.isTradeFeeVisible);
// Validation // Validation
amountTextField.validationResultProperty().bind(model.amountValidationResult); amountTextField.validationResultProperty().bind(model.amountValidationResult);
@ -646,6 +639,9 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
tradeFeeInBtcLabel.textProperty().unbind(); tradeFeeInBtcLabel.textProperty().unbind();
tradeFeeInBsqLabel.textProperty().unbind(); tradeFeeInBsqLabel.textProperty().unbind();
tradeFeeDescriptionLabel.textProperty().unbind(); tradeFeeDescriptionLabel.textProperty().unbind();
tradeFeeInBtcLabel.visibleProperty().unbind();
tradeFeeInBsqLabel.visibleProperty().unbind();
tradeFeeDescriptionLabel.visibleProperty().unbind();
// Validation // Validation
amountTextField.validationResultProperty().unbind(); amountTextField.validationResultProperty().unbind();
@ -833,6 +829,13 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
setIsCurrencyForMakerFeeBtc(!newValue); setIsCurrencyForMakerFeeBtc(!newValue);
}; };
tradeFeeVisibleListener = (observable, oldValue, newValue) -> {
if (DevEnv.isDaoActivated()) {
tradeFeeInBtcToggle.setVisible(newValue);
tradeFeeInBsqToggle.setVisible(newValue);
}
};
} }
private void setIsCurrencyForMakerFeeBtc(boolean isCurrencyForMakerFeeBtc) { private void setIsCurrencyForMakerFeeBtc(boolean isCurrencyForMakerFeeBtc) {
@ -868,6 +871,8 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
model.marketPriceAvailableProperty.addListener(marketPriceAvailableListener); model.marketPriceAvailableProperty.addListener(marketPriceAvailableListener);
model.marketPriceMargin.addListener(marketPriceMarginListener); model.marketPriceMargin.addListener(marketPriceMarginListener);
model.volume.addListener(volumeListener); model.volume.addListener(volumeListener);
model.isTradeFeeVisible.addListener(tradeFeeVisibleListener);
tradeFeeInBtcToggle.selectedProperty().addListener(tradeFeeInBtcToggleListener); tradeFeeInBtcToggle.selectedProperty().addListener(tradeFeeInBtcToggleListener);
tradeFeeInBsqToggle.selectedProperty().addListener(tradeFeeInBsqToggleListener); tradeFeeInBsqToggle.selectedProperty().addListener(tradeFeeInBsqToggleListener);
@ -898,6 +903,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
model.marketPriceAvailableProperty.removeListener(marketPriceAvailableListener); model.marketPriceAvailableProperty.removeListener(marketPriceAvailableListener);
model.marketPriceMargin.removeListener(marketPriceMarginListener); model.marketPriceMargin.removeListener(marketPriceMarginListener);
model.volume.removeListener(volumeListener); model.volume.removeListener(volumeListener);
model.isTradeFeeVisible.removeListener(tradeFeeVisibleListener);
tradeFeeInBtcToggle.selectedProperty().removeListener(tradeFeeInBtcToggleListener); tradeFeeInBtcToggle.selectedProperty().removeListener(tradeFeeInBtcToggleListener);
tradeFeeInBsqToggle.selectedProperty().removeListener(tradeFeeInBsqToggleListener); tradeFeeInBsqToggle.selectedProperty().removeListener(tradeFeeInBsqToggleListener);
@ -953,9 +959,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
columnConstraints1.setMinWidth(200); columnConstraints1.setMinWidth(200);
ColumnConstraints columnConstraints2 = new ColumnConstraints(); ColumnConstraints columnConstraints2 = new ColumnConstraints();
columnConstraints2.setHgrow(Priority.ALWAYS); columnConstraints2.setHgrow(Priority.ALWAYS);
ColumnConstraints columnConstraints3 = new ColumnConstraints(); gridPane.getColumnConstraints().addAll(columnConstraints1, columnConstraints2);
columnConstraints3.setHgrow(Priority.NEVER);
gridPane.getColumnConstraints().addAll(columnConstraints1, columnConstraints2, columnConstraints3);
scrollPane.setContent(gridPane); scrollPane.setContent(gridPane);
} }
@ -1110,10 +1114,10 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
Tuple3<HBox, InputTextField, Label> tuple = getEditableValueBox( Tuple3<HBox, InputTextField, Label> tuple = getEditableValueBox(
Res.get("createOffer.securityDeposit.prompt")); Res.get("createOffer.securityDeposit.prompt"));
buyerSecurityDepositInputTextField = tuple.second; buyerSecurityDepositInputTextField = tuple.second;
buyerSecurityDepositBtcLabel = tuple.third; Label buyerSecurityDepositBtcLabel = tuple.third;
VBox depositBox = getTradeInputBox(tuple.first, Res.get("createOffer.setDeposit")).second; VBox depositBox = getTradeInputBox(tuple.first, Res.get("createOffer.setDeposit")).second;
depositBox.setMaxWidth(300); depositBox.setMaxWidth(310);
editOfferElements.add(buyerSecurityDepositInputTextField); editOfferElements.add(buyerSecurityDepositInputTextField);
editOfferElements.add(buyerSecurityDepositBtcLabel); editOfferElements.add(buyerSecurityDepositBtcLabel);
@ -1304,6 +1308,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
firstRowHBox.setSpacing(5); firstRowHBox.setSpacing(5);
firstRowHBox.setAlignment(Pos.CENTER_LEFT); firstRowHBox.setAlignment(Pos.CENTER_LEFT);
firstRowHBox.getChildren().addAll(amountBox, xLabel, percentagePriceBox, resultLabel, volumeBox); firstRowHBox.getChildren().addAll(amountBox, xLabel, percentagePriceBox, resultLabel, volumeBox);
GridPane.setColumnSpan(firstRowHBox, 2);
GridPane.setRowIndex(firstRowHBox, gridRow); GridPane.setRowIndex(firstRowHBox, gridRow);
GridPane.setMargin(firstRowHBox, new Insets(Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE, 10, 0, 0)); GridPane.setMargin(firstRowHBox, new Insets(Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE, 10, 0, 0));
gridPane.getChildren().add(firstRowHBox); gridPane.getChildren().add(firstRowHBox);
@ -1409,10 +1414,12 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
tradeFeeInBtcToggle = new AutoTooltipSlideToggleButton(); tradeFeeInBtcToggle = new AutoTooltipSlideToggleButton();
tradeFeeInBtcToggle.setText("BTC"); tradeFeeInBtcToggle.setText("BTC");
tradeFeeInBtcToggle.setVisible(false);
tradeFeeInBtcToggle.setPadding(new Insets(-8, 5, -10, 5)); tradeFeeInBtcToggle.setPadding(new Insets(-8, 5, -10, 5));
tradeFeeInBsqToggle = new AutoTooltipSlideToggleButton(); tradeFeeInBsqToggle = new AutoTooltipSlideToggleButton();
tradeFeeInBsqToggle.setText("BSQ"); tradeFeeInBsqToggle.setText("BSQ");
tradeFeeInBsqToggle.setVisible(false);
tradeFeeInBsqToggle.setPadding(new Insets(-9, 5, -9, 5)); tradeFeeInBsqToggle.setPadding(new Insets(-9, 5, -9, 5));
VBox tradeFeeToggleButtonBox = new VBox(); VBox tradeFeeToggleButtonBox = new VBox();

View File

@ -117,6 +117,7 @@ public abstract class MutableOfferViewModel<M extends MutableOfferDataModel> ext
final StringProperty tradeFeeInBsqWithFiat = new SimpleStringProperty(); final StringProperty tradeFeeInBsqWithFiat = new SimpleStringProperty();
final StringProperty tradeFeeCurrencyCode = new SimpleStringProperty(); final StringProperty tradeFeeCurrencyCode = new SimpleStringProperty();
final StringProperty tradeFeeDescription = 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: // Positive % value means always a better price form the maker's perspective:
// Buyer (with fiat): lower price as market // Buyer (with fiat): lower price as market
@ -491,6 +492,8 @@ public abstract class MutableOfferViewModel<M extends MutableOfferDataModel> ext
private void applyMakerFee() { private void applyMakerFee() {
Coin makerFeeAsCoin = dataModel.getMakerFee(); Coin makerFeeAsCoin = dataModel.getMakerFee();
if (makerFeeAsCoin != null) { if (makerFeeAsCoin != null) {
isTradeFeeVisible.setValue(true);
tradeFee.set(getFormatterForMakerFee().formatCoin(makerFeeAsCoin)); tradeFee.set(getFormatterForMakerFee().formatCoin(makerFeeAsCoin));
Coin makerFeeInBtc = dataModel.getMakerFeeInBtc(); Coin makerFeeInBtc = dataModel.getMakerFeeInBtc();

View File

@ -161,7 +161,8 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
private ChangeListener<Boolean> amountFocusedListener, getShowWalletFundedNotificationListener; private ChangeListener<Boolean> amountFocusedListener, getShowWalletFundedNotificationListener;
private InfoInputTextField volumeInfoTextField; private InfoInputTextField volumeInfoTextField;
private AutoTooltipSlideToggleButton tradeFeeInBtcToggle, tradeFeeInBsqToggle; private AutoTooltipSlideToggleButton tradeFeeInBtcToggle, tradeFeeInBsqToggle;
private ChangeListener<Boolean> tradeFeeInBtcToggleListener, tradeFeeInBsqToggleListener; private ChangeListener<Boolean> tradeFeeInBtcToggleListener, tradeFeeInBsqToggleListener,
tradeFeeVisibleListener;
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
// Constructor, lifecycle // Constructor, lifecycle
@ -232,6 +233,13 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
setIsCurrencyForMakerFeeBtc(!newValue); setIsCurrencyForMakerFeeBtc(!newValue);
}; };
tradeFeeVisibleListener = (observable, oldValue, newValue) -> {
if (DevEnv.isDaoActivated()) {
tradeFeeInBtcToggle.setVisible(newValue);
tradeFeeInBsqToggle.setVisible(newValue);
}
};
GUIUtil.focusWhenAddedToScene(amountTextField); GUIUtil.focusWhenAddedToScene(amountTextField);
} }
@ -602,6 +610,9 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
tradeFeeInBtcLabel.textProperty().bind(model.tradeFeeInBtcWithFiat); tradeFeeInBtcLabel.textProperty().bind(model.tradeFeeInBtcWithFiat);
tradeFeeInBsqLabel.textProperty().bind(model.tradeFeeInBsqWithFiat); tradeFeeInBsqLabel.textProperty().bind(model.tradeFeeInBsqWithFiat);
tradeFeeDescriptionLabel.textProperty().bind(model.tradeFeeDescription); tradeFeeDescriptionLabel.textProperty().bind(model.tradeFeeDescription);
tradeFeeInBtcLabel.visibleProperty().bind(model.isTradeFeeVisible);
tradeFeeInBsqLabel.visibleProperty().bind(model.isTradeFeeVisible);
tradeFeeDescriptionLabel.visibleProperty().bind(model.isTradeFeeVisible);
// funding // funding
fundingHBox.visibleProperty().bind(model.dataModel.getIsBtcWalletFunded().not().and(model.showPayFundsScreenDisplayed)); fundingHBox.visibleProperty().bind(model.dataModel.getIsBtcWalletFunded().not().and(model.showPayFundsScreenDisplayed));
@ -624,6 +635,9 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
tradeFeeInBtcLabel.textProperty().unbind(); tradeFeeInBtcLabel.textProperty().unbind();
tradeFeeInBsqLabel.textProperty().unbind(); tradeFeeInBsqLabel.textProperty().unbind();
tradeFeeDescriptionLabel.textProperty().unbind(); tradeFeeDescriptionLabel.textProperty().unbind();
tradeFeeInBtcLabel.visibleProperty().unbind();
tradeFeeInBsqLabel.visibleProperty().unbind();
tradeFeeDescriptionLabel.visibleProperty().unbind();
// funding // funding
fundingHBox.visibleProperty().unbind(); fundingHBox.visibleProperty().unbind();
@ -766,6 +780,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
private void addListeners() { private void addListeners() {
amountTextField.focusedProperty().addListener(amountFocusedListener); amountTextField.focusedProperty().addListener(amountFocusedListener);
model.dataModel.getShowWalletFundedNotification().addListener(getShowWalletFundedNotificationListener); model.dataModel.getShowWalletFundedNotification().addListener(getShowWalletFundedNotificationListener);
model.isTradeFeeVisible.addListener(tradeFeeVisibleListener);
tradeFeeInBtcToggle.selectedProperty().addListener(tradeFeeInBtcToggleListener); tradeFeeInBtcToggle.selectedProperty().addListener(tradeFeeInBtcToggleListener);
tradeFeeInBsqToggle.selectedProperty().addListener(tradeFeeInBsqToggleListener); tradeFeeInBsqToggle.selectedProperty().addListener(tradeFeeInBsqToggleListener);
} }
@ -773,6 +788,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
private void removeListeners() { private void removeListeners() {
amountTextField.focusedProperty().removeListener(amountFocusedListener); amountTextField.focusedProperty().removeListener(amountFocusedListener);
model.dataModel.getShowWalletFundedNotification().removeListener(getShowWalletFundedNotificationListener); model.dataModel.getShowWalletFundedNotification().removeListener(getShowWalletFundedNotificationListener);
model.isTradeFeeVisible.removeListener(tradeFeeVisibleListener);
tradeFeeInBtcToggle.selectedProperty().removeListener(tradeFeeInBtcToggleListener); tradeFeeInBtcToggle.selectedProperty().removeListener(tradeFeeInBtcToggleListener);
tradeFeeInBsqToggle.selectedProperty().removeListener(tradeFeeInBsqToggleListener); tradeFeeInBsqToggle.selectedProperty().removeListener(tradeFeeInBsqToggleListener);
} }

View File

@ -103,6 +103,7 @@ class TakeOfferViewModel extends ActivatableWithDataModel<TakeOfferDataModel> im
final StringProperty tradeFeeInBtcWithFiat = new SimpleStringProperty(); final StringProperty tradeFeeInBtcWithFiat = new SimpleStringProperty();
final StringProperty tradeFeeInBsqWithFiat = new SimpleStringProperty(); final StringProperty tradeFeeInBsqWithFiat = new SimpleStringProperty();
final StringProperty tradeFeeDescription = new SimpleStringProperty(); final StringProperty tradeFeeDescription = new SimpleStringProperty();
final BooleanProperty isTradeFeeVisible = new SimpleBooleanProperty(false);
final BooleanProperty isOfferAvailable = new SimpleBooleanProperty(); final BooleanProperty isOfferAvailable = new SimpleBooleanProperty();
final BooleanProperty isTakeOfferButtonDisabled = new SimpleBooleanProperty(true); final BooleanProperty isTakeOfferButtonDisabled = new SimpleBooleanProperty(true);
@ -274,6 +275,8 @@ class TakeOfferViewModel extends ActivatableWithDataModel<TakeOfferDataModel> im
private void applyTakerFee() { private void applyTakerFee() {
Coin takerFeeAsCoin = dataModel.getTakerFee(); Coin takerFeeAsCoin = dataModel.getTakerFee();
if (takerFeeAsCoin != null) { if (takerFeeAsCoin != null) {
isTradeFeeVisible.setValue(true);
tradeFee.set(getFormatterForTakerFee().formatCoin(takerFeeAsCoin)); tradeFee.set(getFormatterForTakerFee().formatCoin(takerFeeAsCoin));
Coin makerFeeInBtc = dataModel.getTakerFeeInBtc(); Coin makerFeeInBtc = dataModel.getTakerFeeInBtc();

View File

@ -856,6 +856,7 @@ public abstract class Overlay<T extends Overlay> {
else else
hBox.getChildren().addAll(spacer, actionButton); hBox.getChildren().addAll(spacer, actionButton);
HBox.setHgrow(spacer, Priority.ALWAYS); HBox.setHgrow(spacer, Priority.ALWAYS);
spacer.setMaxWidth(Double.MAX_VALUE);
GridPane.setHalignment(hBox, HPos.RIGHT); GridPane.setHalignment(hBox, HPos.RIGHT);
GridPane.setRowIndex(hBox, ++rowIndex); GridPane.setRowIndex(hBox, ++rowIndex);
@ -865,6 +866,7 @@ public abstract class Overlay<T extends Overlay> {
} else if (!hideCloseButton) { } else if (!hideCloseButton) {
closeButton.setDefaultButton(true); closeButton.setDefaultButton(true);
GridPane.setHalignment(closeButton, HPos.RIGHT); GridPane.setHalignment(closeButton, HPos.RIGHT);
GridPane.setColumnSpan(closeButton, 2);
if (!showReportErrorButtons) if (!showReportErrorButtons)
GridPane.setMargin(closeButton, new Insets(buttonDistance, 0, 0, 0)); GridPane.setMargin(closeButton, new Insets(buttonDistance, 0, 0, 0));
GridPane.setRowIndex(closeButton, ++rowIndex); GridPane.setRowIndex(closeButton, ++rowIndex);

View File

@ -21,7 +21,6 @@ import bisq.desktop.components.AutoTooltipButton;
import bisq.desktop.components.InputTextField; import bisq.desktop.components.InputTextField;
import bisq.desktop.main.overlays.Overlay; import bisq.desktop.main.overlays.Overlay;
import bisq.desktop.main.overlays.popups.Popup; import bisq.desktop.main.overlays.popups.Popup;
import bisq.desktop.util.FormBuilder;
import bisq.desktop.util.GUIUtil; import bisq.desktop.util.GUIUtil;
import bisq.desktop.util.Transitions; import bisq.desktop.util.Transitions;
@ -61,6 +60,7 @@ import java.util.concurrent.TimeUnit;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import static bisq.desktop.util.FormBuilder.addInputTextField;
import static bisq.desktop.util.FormBuilder.addMultilineLabel; import static bisq.desktop.util.FormBuilder.addMultilineLabel;
import static bisq.desktop.util.FormBuilder.addTopLabelTextField; import static bisq.desktop.util.FormBuilder.addTopLabelTextField;
@ -152,7 +152,7 @@ public class EmptyWalletWindow extends Overlay<EmptyWalletWindow> {
getFormatter().formatCoinWithCode(totalBalance), 10).second; getFormatter().formatCoinWithCode(totalBalance), 10).second;
if (isBtc) { if (isBtc) {
addressInputTextField = FormBuilder.addInputTextField(gridPane, ++rowIndex, Res.get("emptyWalletWindow.address")); addressInputTextField = addInputTextField(gridPane, ++rowIndex, Res.get("emptyWalletWindow.address"));
} else { } else {
addTopLabelTextField(gridPane, ++rowIndex, Res.get("emptyWalletWindow.bsq.btcBalance"), addTopLabelTextField(gridPane, ++rowIndex, Res.get("emptyWalletWindow.bsq.btcBalance"),
bsqFormatter.formatBTCWithCode(bsqWalletService.getAvailableNonBsqBalance().value), 10); bsqFormatter.formatBTCWithCode(bsqWalletService.getAvailableNonBsqBalance().value), 10);
@ -190,7 +190,6 @@ public class EmptyWalletWindow extends Overlay<EmptyWalletWindow> {
HBox hBox = new HBox(); HBox hBox = new HBox();
hBox.setSpacing(10); hBox.setSpacing(10);
GridPane.setRowIndex(hBox, ++rowIndex); GridPane.setRowIndex(hBox, ++rowIndex);
GridPane.setColumnIndex(hBox, 1);
if (isBtc) if (isBtc)
hBox.getChildren().addAll(emptyWalletButton, closeButton); hBox.getChildren().addAll(emptyWalletButton, closeButton);

View File

@ -23,7 +23,6 @@ import bisq.desktop.components.BusyAnimation;
import bisq.desktop.components.PasswordTextField; import bisq.desktop.components.PasswordTextField;
import bisq.desktop.main.overlays.Overlay; import bisq.desktop.main.overlays.Overlay;
import bisq.desktop.main.overlays.popups.Popup; import bisq.desktop.main.overlays.popups.Popup;
import bisq.desktop.util.FormBuilder;
import bisq.desktop.util.GUIUtil; import bisq.desktop.util.GUIUtil;
import bisq.desktop.util.Transitions; import bisq.desktop.util.Transitions;
@ -49,7 +48,6 @@ import javafx.scene.Scene;
import javafx.scene.control.Button; import javafx.scene.control.Button;
import javafx.scene.control.DatePicker; import javafx.scene.control.DatePicker;
import javafx.scene.control.Label; import javafx.scene.control.Label;
import javafx.scene.control.Separator;
import javafx.scene.control.TextArea; import javafx.scene.control.TextArea;
import javafx.scene.input.KeyCode; import javafx.scene.input.KeyCode;
import javafx.scene.layout.ColumnConstraints; import javafx.scene.layout.ColumnConstraints;
@ -59,7 +57,6 @@ import javafx.scene.layout.Priority;
import javafx.geometry.HPos; import javafx.geometry.HPos;
import javafx.geometry.Insets; import javafx.geometry.Insets;
import javafx.geometry.Orientation;
import javafx.geometry.Pos; import javafx.geometry.Pos;
import javafx.beans.property.BooleanProperty; import javafx.beans.property.BooleanProperty;
@ -80,7 +77,9 @@ import java.util.concurrent.TimeUnit;
import lombok.extern.slf4j.Slf4j; 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 bisq.desktop.util.FormBuilder.addTopLabelDatePicker;
import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkArgument;
import static javafx.beans.binding.Bindings.createBooleanBinding; import static javafx.beans.binding.Bindings.createBooleanBinding;
@ -102,7 +101,6 @@ public class WalletPasswordWindow extends Overlay<WalletPasswordWindow> {
private ChangeListener<String> changeListener; private ChangeListener<String> changeListener;
private ChangeListener<String> wordsTextAreaChangeListener; private ChangeListener<String> wordsTextAreaChangeListener;
private ChangeListener<Boolean> seedWordsValidChangeListener; private ChangeListener<Boolean> seedWordsValidChangeListener;
private LocalDate walletCreationDate;
private boolean hideForgotPasswordButton = false; private boolean hideForgotPasswordButton = false;
@ -120,7 +118,7 @@ public class WalletPasswordWindow extends Overlay<WalletPasswordWindow> {
this.walletsManager = walletsManager; this.walletsManager = walletsManager;
this.storageDir = storageDir; this.storageDir = storageDir;
type = Type.Attention; type = Type.Attention;
width = 868; width = 900;
} }
@ -191,18 +189,11 @@ public class WalletPasswordWindow extends Overlay<WalletPasswordWindow> {
} }
private void addInputFields() { private void addInputFields() {
Label label = new AutoTooltipLabel(Res.get("password.enterPassword")); passwordTextField = addPasswordTextField(gridPane, ++rowIndex, Res.get("password.enterPassword"));
label.setWrapText(true); GridPane.setColumnSpan(passwordTextField, 1);
GridPane.setMargin(label, new Insets(3, 0, 0, 0)); GridPane.setHalignment(passwordTextField, HPos.LEFT);
GridPane.setRowIndex(label, ++rowIndex);
passwordTextField = new PasswordTextField();
GridPane.setMargin(passwordTextField, new Insets(3, 0, 0, 0));
GridPane.setRowIndex(passwordTextField, rowIndex);
GridPane.setColumnIndex(passwordTextField, 1);
changeListener = (observable, oldValue, newValue) -> unlockButton.setDisable(!passwordTextField.validate()); changeListener = (observable, oldValue, newValue) -> unlockButton.setDisable(!passwordTextField.validate());
passwordTextField.textProperty().addListener(changeListener); passwordTextField.textProperty().addListener(changeListener);
gridPane.getChildren().addAll(label, passwordTextField);
} }
private void addButtons() { private void addButtons() {
@ -211,6 +202,7 @@ public class WalletPasswordWindow extends Overlay<WalletPasswordWindow> {
unlockButton = new AutoTooltipButton(Res.get("shared.unlock")); unlockButton = new AutoTooltipButton(Res.get("shared.unlock"));
unlockButton.setDefaultButton(true); unlockButton.setDefaultButton(true);
unlockButton.getStyleClass().add("action-button");
unlockButton.setDisable(true); unlockButton.setDisable(true);
unlockButton.setOnAction(e -> { unlockButton.setOnAction(e -> {
String password = passwordTextField.getText(); String password = passwordTextField.getText();
@ -254,9 +246,9 @@ public class WalletPasswordWindow extends Overlay<WalletPasswordWindow> {
HBox hBox = new HBox(); HBox hBox = new HBox();
hBox.setMinWidth(560); hBox.setMinWidth(560);
hBox.setPadding(new Insets(15, 0, 0, 0));
hBox.setSpacing(10); hBox.setSpacing(10);
GridPane.setRowIndex(hBox, ++rowIndex); GridPane.setRowIndex(hBox, ++rowIndex);
GridPane.setColumnIndex(hBox, 1);
hBox.setAlignment(Pos.CENTER_LEFT); hBox.setAlignment(Pos.CENTER_LEFT);
hBox.getChildren().add(unlockButton); hBox.getChildren().add(unlockButton);
if (!hideForgotPasswordButton) if (!hideForgotPasswordButton)
@ -268,48 +260,34 @@ public class WalletPasswordWindow extends Overlay<WalletPasswordWindow> {
ColumnConstraints columnConstraints1 = new ColumnConstraints(); ColumnConstraints columnConstraints1 = new ColumnConstraints();
columnConstraints1.setHalignment(HPos.RIGHT); columnConstraints1.setHalignment(HPos.LEFT);
columnConstraints1.setHgrow(Priority.SOMETIMES); columnConstraints1.setHgrow(Priority.ALWAYS);
ColumnConstraints columnConstraints2 = new ColumnConstraints(); gridPane.getColumnConstraints().addAll(columnConstraints1);
columnConstraints2.setHgrow(Priority.ALWAYS);
gridPane.getColumnConstraints().addAll(columnConstraints1, columnConstraints2);
} }
private void showRestoreScreen() { private void showRestoreScreen() {
Label headLine2Label = new AutoTooltipLabel(Res.get("seed.restore.title")); Label headLine2Label = new AutoTooltipLabel(Res.get("seed.restore.title"));
headLine2Label.setId("popup-headline"); headLine2Label.getStyleClass().add("popup-headline");
headLine2Label.setMouseTransparent(true); headLine2Label.setMouseTransparent(true);
GridPane.setHalignment(headLine2Label, HPos.LEFT); GridPane.setHalignment(headLine2Label, HPos.LEFT);
GridPane.setRowIndex(headLine2Label, ++rowIndex); GridPane.setRowIndex(headLine2Label, ++rowIndex);
GridPane.setColumnSpan(headLine2Label, 2);
GridPane.setMargin(headLine2Label, new Insets(30, 0, 0, 0)); GridPane.setMargin(headLine2Label, new Insets(30, 0, 0, 0));
gridPane.getChildren().add(headLine2Label); gridPane.getChildren().add(headLine2Label);
Separator separator = new Separator(); seedWordsTextArea = addTextArea(gridPane, ++rowIndex, Res.get("seed.enterSeedWords"), 5);
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<Label, TextArea> tuple = FormBuilder.addTopLabelTextArea(gridPane, ++rowIndex, Res.get("seed.seedWords"), "", 5);
seedWordsTextArea = tuple.second;
seedWordsTextArea.setPrefHeight(60); seedWordsTextArea.setPrefHeight(60);
seedWordsTextArea.getStyleClass().add("text-area");
Tuple2<Label, DatePicker> labelDatePickerTuple2 = addTopLabelDatePicker(gridPane, ++rowIndex, Tuple2<Label, DatePicker> labelDatePickerTuple2 = addTopLabelDatePicker(gridPane, ++rowIndex,
Res.get("seed.creationDate"), 10); Res.get("seed.creationDate"), 10);
datePicker = labelDatePickerTuple2.second; datePicker = labelDatePickerTuple2.second;
restoreButton = addButton(gridPane, ++rowIndex, Res.get("seed.restore")); restoreButton = addPrimaryActionButton(gridPane, ++rowIndex, Res.get("seed.restore"), 0);
restoreButton.setDefaultButton(true); restoreButton.setDefaultButton(true);
stage.setHeight(340); stage.setHeight(570);
// wallet creation date is not encrypted // 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); log.info("walletCreationDate " + walletCreationDate);
datePicker.setValue(walletCreationDate); datePicker.setValue(walletCreationDate);
restoreButton.disableProperty().bind(createBooleanBinding(() -> !seedWordsValid.get() || !seedWordsEdited.get(), restoreButton.disableProperty().bind(createBooleanBinding(() -> !seedWordsValid.get() || !seedWordsEdited.get(),

View File

@ -354,6 +354,18 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Preferenc
Layout.FIRST_ROW_DISTANCE); Layout.FIRST_ROW_DISTANCE);
GridPane.setColumnIndex(preferredTradeCurrencyComboBox, 2); GridPane.setColumnIndex(preferredTradeCurrencyComboBox, 2);
preferredTradeCurrencyComboBox.setConverter(new StringConverter<>() {
@Override
public String toString(TradeCurrency object) {
return object.getCode() + " - " + object.getName();
}
@Override
public TradeCurrency fromString(String string) {
return null;
}
});
preferredTradeCurrencyComboBox.setButtonCell(GUIUtil.getTradeCurrencyButtonCell("", "", preferredTradeCurrencyComboBox.setButtonCell(GUIUtil.getTradeCurrencyButtonCell("", "",
Collections.emptyMap())); Collections.emptyMap()));
preferredTradeCurrencyComboBox.setCellFactory(GUIUtil.getTradeCurrencyCellFactory("", "", preferredTradeCurrencyComboBox.setCellFactory(GUIUtil.getTradeCurrencyCellFactory("", "",

View File

@ -434,6 +434,10 @@ public class FormBuilder {
// Label + TextArea // Label + TextArea
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
public static Tuple2<Label, TextArea> addCompactTopLabelTextArea(GridPane gridPane, int rowIndex, String title, String prompt) {
return addTopLabelTextArea(gridPane, rowIndex, title, prompt, -Layout.FLOATING_LABEL_DISTANCE);
}
public static Tuple2<Label, TextArea> addTopLabelTextArea(GridPane gridPane, int rowIndex, String title, String prompt) { public static Tuple2<Label, TextArea> addTopLabelTextArea(GridPane gridPane, int rowIndex, String title, String prompt) {
return addTopLabelTextArea(gridPane, rowIndex, title, prompt, 0); return addTopLabelTextArea(gridPane, rowIndex, title, prompt, 0);
} }
@ -1385,6 +1389,10 @@ public class FormBuilder {
return addButton(gridPane, rowIndex, title, top, true); 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) { public static Button addButton(GridPane gridPane, int rowIndex, String title, double top) {
return addButton(gridPane, rowIndex, title, top, false); return addButton(gridPane, rowIndex, title, top, false);
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 892 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB