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. \
You can do this at \"Account/Backup\".\n\n\
Please report us your problem and file a bug report on GitHub or at the Bisq forum so that we can investigate what was causing the problem.
emptyWalletWindow.balance=Your available wallet balance:
emptyWalletWindow.bsq.btcBalance=Balance of non-BSQ Satoshis:
emptyWalletWindow.balance=Your available wallet balance
emptyWalletWindow.bsq.btcBalance=Balance of non-BSQ Satoshis
emptyWalletWindow.address=Your destination address:
emptyWalletWindow.address=Your destination address
emptyWalletWindow.button=Send all funds
emptyWalletWindow.openOffers.warn=You have open offers which will be removed if you empty the wallet.\nAre you sure that you want to empty your wallet?
emptyWalletWindow.openOffers.yes=Yes, I am sure
@ -2206,6 +2206,7 @@ password.backupReminder=Please note that when setting a wallet password all auto
password.backupWasDone=I have already done a backup
seed.seedWords=Wallet seed words
seed.enterSeedWords=Enter wallet seed words
seed.date=Wallet date
seed.restore.title=Restore wallets from seed words
seed.restore=Restore wallets
@ -2516,8 +2517,8 @@ validation.accountNrChars=Account number must consist of {0} characters.
validation.btc.invalidAddress=The address is not correct. Please check the address format.
validation.integerOnly=Please enter integer numbers only.
validation.inputError=Your input caused an error:\n{0}
validation.bsq.insufficientBalance=Amount exceeds the available balance of {0}.
validation.btc.exceedsMaxTradeLimit=Amount larger than your trade limit of {0} is not allowed.
validation.bsq.insufficientBalance=Your available balance is {0}.
validation.btc.exceedsMaxTradeLimit=Your trade limit is {0}.
validation.bsq.amountBelowMinAmount=Min. amount is {0}
validation.nationalAccountId={0} must consist of {1} numbers.

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -86,14 +86,14 @@ public class PromptPayForm extends PaymentMethodForm {
gridRowFrom = gridRow;
addTopLabelTextField(gridPane, gridRow, Res.get("payment.account.name"),
promptPayAccount.getAccountName(), Layout.FIRST_ROW_AND_GROUP_DISTANCE);
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"),
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.paymentMethod"),
Res.get(promptPayAccount.getPaymentMethod().getId()));
TextField field = addTopLabelTextField(gridPane, ++gridRow, Res.get("payment.promptPay.promptPayId"),
TextField field = addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("payment.promptPay.promptPayId"),
promptPayAccount.getPromptPayId()).second;
field.setMouseTransparent(false);
TradeCurrency singleTradeCurrency = promptPayAccount.getSingleTradeCurrency();
String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null";
addTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addCompactTopLabelTextField(gridPane, ++gridRow, Res.get("shared.currency"), nameAndCode);
addLimitations();
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -78,8 +78,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import static bisq.desktop.util.FormBuilder.addButton;
import static bisq.desktop.util.FormBuilder.addSlideToggleButton;
import static bisq.desktop.util.FormBuilder.*;
@FxmlView
public class MobileNotificationsView extends ActivatableView<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() {
MobileMessage message = null;
List<MobileMessage> messages = null;
@ -393,23 +393,21 @@ public class MobileNotificationsView extends ActivatableView<GridPane, Void> {
///////////////////////////////////////////////////////////////////////////////////////////
private void createSetupFields() {
FormBuilder.addTitledGroupBg(root, gridRow, 4, Res.get("account.notifications.setup.title"));
addTitledGroupBg(root, gridRow, 4, Res.get("account.notifications.setup.title"));
downloadButton = addButton(root, gridRow,
Res.get("account.notifications.download.label"),
Layout.FIRST_ROW_DISTANCE);
Layout.TWICE_FIRST_ROW_DISTANCE);
Tuple3<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.button"), Res.get("account.notifications.noWebcam.button"), 0);
webCamButton = tuple.second;
noWebCamButton = tuple.third;
tokenInputTextField = FormBuilder.addInputTextField(root, ++gridRow,
tokenInputTextField = addInputTextField(root, ++gridRow,
Res.get("account.notifications.email.label"));
tokenInputTextField.setPromptText(Res.get("account.notifications.email.prompt"));
tokenInputTextFieldListener = (observable, oldValue, newValue) -> {
applyKeyAndToken(newValue);
};
tokenInputTextFieldListener = (observable, oldValue, newValue) -> applyKeyAndToken(newValue);
tokenInputTextField.setManaged(false);
tokenInputTextField.setVisible(false);
@ -417,14 +415,14 @@ public class MobileNotificationsView extends ActivatableView<GridPane, Void> {
Res.get("account.notifications.testMsg.title")).second;
testMsgButton.setDefaultButton(false);*/
eraseButton = FormBuilder.addTopLabelButton(root, ++gridRow,
eraseButton = addTopLabelButton(root, ++gridRow,
Res.get("account.notifications.erase.label"),
Res.get("account.notifications.erase.title")).second;
eraseButton.setId("notification-erase-button");
}
private void createSettingsFields() {
FormBuilder.addTitledGroupBg(root, ++gridRow, 4,
addTitledGroupBg(root, ++gridRow, 4,
Res.get("account.notifications.settings.title"),
Layout.GROUP_DISTANCE);
@ -464,9 +462,9 @@ public class MobileNotificationsView extends ActivatableView<GridPane, Void> {
}
private void createMarketAlertFields() {
FormBuilder.addTitledGroupBg(root, ++gridRow, 4, Res.get("account.notifications.marketAlert.title"),
addTitledGroupBg(root, ++gridRow, 4, Res.get("account.notifications.marketAlert.title"),
Layout.GROUP_DISTANCE);
paymentAccountsComboBox = FormBuilder.<PaymentAccount>addComboBox(root, gridRow,
paymentAccountsComboBox = FormBuilder.addComboBox(root, gridRow,
Res.get("account.notifications.marketAlert.selectPaymentAccount"),
Layout.FIRST_ROW_AND_GROUP_DISTANCE);
paymentAccountsComboBox.setConverter(new StringConverter<>() {
@ -503,9 +501,7 @@ public class MobileNotificationsView extends ActivatableView<GridPane, Void> {
infoInputTextField.setContentForInfoPopOver(createMarketAlertPriceInfoPopupLabel(Res.get("account.notifications.marketAlert.trigger.info")));
infoInputTextField.setIconsRightAligned();
marketAlertTriggerListener = (observable, oldValue, newValue) -> {
updateMarketAlertFields();
};
marketAlertTriggerListener = (observable, oldValue, newValue) -> updateMarketAlertFields();
marketAlertTriggerFocusListener = (observable, oldValue, newValue) -> {
if (oldValue && !newValue) {
try {
@ -526,12 +522,12 @@ public class MobileNotificationsView extends ActivatableView<GridPane, Void> {
}
private void createPriceAlertFields() {
FormBuilder.addTitledGroupBg(root, ++gridRow, 4,
addTitledGroupBg(root, ++gridRow, 4,
Res.get("account.notifications.priceAlert.title"), 20);
currencyComboBox = FormBuilder.<TradeCurrency>addComboBox(root, gridRow,
currencyComboBox = FormBuilder.addComboBox(root, gridRow,
Res.getWithCol("list.currency.select"), 40);
currencyComboBox.setPromptText(Res.get("list.currency.select"));
currencyComboBox.setConverter(new StringConverter<TradeCurrency>() {
currencyComboBox.setConverter(new StringConverter<>() {
@Override
public String toString(TradeCurrency currency) {
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"));
priceAlertHighListener = (observable, oldValue, newValue) -> {
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"));
priceAlertLowListener = (observable, oldValue, newValue) -> {
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
// to the next frame. The priceFeedServiceListener in the mobileNotificationService might get called before
// our listener here.
priceFeedServiceListener = (observable, oldValue, newValue) -> {
UserThread.execute(() -> {
fillPriceAlertFields();
updatePriceAlertFields();
});
};
priceFeedServiceListener = (observable, oldValue, newValue) -> UserThread.execute(() -> {
fillPriceAlertFields();
updatePriceAlertFields();
});
}

View File

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

View File

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

View File

@ -26,7 +26,7 @@
AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"
xmlns:fx="http://javafx.com/fxml">
<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>
</GridPane>

View File

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

View File

@ -21,7 +21,7 @@
<?import javafx.scene.layout.VBox?>
<?import javafx.geometry.Insets?>
<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.rightAnchor="0.0" AnchorPane.topAnchor="0.0"
xmlns:fx="http://javafx.com/fxml">

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -354,6 +354,18 @@ public class PreferencesView extends ActivatableViewAndModel<GridPane, Preferenc
Layout.FIRST_ROW_DISTANCE);
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("", "",
Collections.emptyMap()));
preferredTradeCurrencyComboBox.setCellFactory(GUIUtil.getTradeCurrencyCellFactory("", "",

View File

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

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