Different clean up tasks in the create offer process

This commit is contained in:
Christoph Atteneder 2018-11-02 16:30:42 +01:00
parent b6fce24d0f
commit 3167195f85
No known key found for this signature in database
GPG Key ID: CD5DC1C529CDFD3B
6 changed files with 82 additions and 91 deletions

View File

@ -191,6 +191,7 @@ shared.fiat=Fiat
shared.crypto=Crypto
shared.all=All
shared.edit=Edit
shared.advancedOptions=Advanced options
####################################################################

View File

@ -1243,7 +1243,6 @@ textfield */
#trade-fee-textfield {
-fx-font-size: 0.9em;
-fx-alignment: center-right;
-fx-background-color: transparent;
}
/* Open Offer */

View File

@ -139,8 +139,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
private Button priceTypeToggleButton;
private InputTextField buyerSecurityDepositInputTextField, fixedPriceTextField, marketBasedPriceTextField;
protected InputTextField amountTextField, minAmountTextField, volumeTextField;
private TextField currencyTextField, tradeFeeInBtcTextField, tradeFeeInBsqTextField;
private VBox currencyTextFieldBox;
private TextField currencyTextField;
private AddressTextField addressTextField;
private BalanceTextField balanceTextField;
private FundsTextField totalToPayTextField;
@ -148,14 +147,18 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
priceCurrencyLabel, priceDescriptionLabel,
volumeDescriptionLabel,
waitingForFundsLabel, marketBasedPriceLabel, percentagePriceDescription,
buyerSecurityDepositBtcLabel;
buyerSecurityDepositBtcLabel, tradeFeeDescriptionLabel, resultLabel,
tradeFeeInBtcLabel, tradeFeeInBsqLabel;
protected Label amountBtcLabel, volumeCurrencyLabel, minAmountBtcLabel;
private ComboBox<PaymentAccount> paymentAccountsComboBox;
private ComboBox<TradeCurrency> currencyComboBox;
private VBox currencySelection;
private ImageView qrCodeImageView;
private VBox fixedPriceBox, percentagePriceBox, tradeFeeBox;
private HBox fundingHBox, firstRowHBox, secondRowHBox, buyerSecurityDepositValueCurrencyBox;
private VBox fixedPriceBox, percentagePriceBox,
currencyTextFieldBox;
private HBox fundingHBox, firstRowHBox, secondRowHBox, placeOfferBox, amountValueCurrencyBox,
priceAsPercentageValueCurrencyBox, volumeValueCurrencyBox, priceValueCurrencyBox,
minAmountValueCurrencyBox, advancedOptionsBox;
private Subscription isWaitingForFundsSubscription, balanceSubscription, cancelButton2StyleSubscription;
private ChangeListener<Boolean> amountFocusedListener, minAmountFocusedListener, volumeFocusedListener,
@ -175,14 +178,6 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
protected TitledGroupBg amountTitledGroupBg;
private AutoTooltipSlideToggleButton tradeFeeInBtcToggle, tradeFeeInBsqToggle;
private ChangeListener<Boolean> tradeFeeInBtcToggleListener, tradeFeeInBsqToggleListener;
private AutoTooltipLabel tradeFeeDescriptionLabel;
private HBox placeOfferBox;
private HBox amountValueCurrencyBox;
private HBox priceAsPercentageValueCurrencyBox;
private HBox volumeValueCurrencyBox;
private HBox priceValueCurrencyBox;
private HBox minAmountValueCurrencyBox;
private AutoTooltipLabel resultLabel;
private Text xIcon, fakeXIcon;
///////////////////////////////////////////////////////////////////////////////////////////
@ -420,11 +415,11 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
transitions.fadeOutAndRemove(setDepositTitledGroupBg, delay, (event) -> {
});
delay -= diff;
transitions.fadeOutAndRemove(buyerSecurityDepositValueCurrencyBox, delay);
transitions.fadeOutAndRemove(advancedOptionsBox, delay);
model.onShowPayFundsScreen();
editOfferElements.stream().forEach(node -> {
editOfferElements.forEach(node -> {
node.setMouseTransparent(true);
node.setFocusTraversable(false);
});
@ -586,8 +581,8 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
totalToPayTextField.textProperty().bind(model.totalToPay);
addressTextField.amountAsCoinProperty().bind(model.getDataModel().getMissingCoin());
buyerSecurityDepositInputTextField.textProperty().bindBidirectional(model.buyerSecurityDeposit);
tradeFeeInBtcTextField.textProperty().bind(model.tradeFeeInBtcWithFiat);
tradeFeeInBsqTextField.textProperty().bind(model.tradeFeeInBsqWithFiat);
tradeFeeInBtcLabel.textProperty().bind(model.tradeFeeInBtcWithFiat);
tradeFeeInBsqLabel.textProperty().bind(model.tradeFeeInBsqWithFiat);
tradeFeeDescriptionLabel.textProperty().bind(model.tradeFeeDescription);
// Validation
@ -633,8 +628,8 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
totalToPayTextField.textProperty().unbind();
addressTextField.amountAsCoinProperty().unbind();
buyerSecurityDepositInputTextField.textProperty().unbindBidirectional(model.buyerSecurityDeposit);
tradeFeeInBtcTextField.textProperty().unbind();
tradeFeeInBsqTextField.textProperty().unbind();
tradeFeeInBtcLabel.textProperty().unbind();
tradeFeeInBsqLabel.textProperty().unbind();
tradeFeeDescriptionLabel.textProperty().unbind();
// Validation
@ -822,8 +817,8 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
private void setIsCurrencyForMakerFeeBtc(boolean isCurrencyForMakerFeeBtc) {
model.setIsCurrencyForMakerFeeBtc(isCurrencyForMakerFeeBtc);
if (DevEnv.isDaoActivated()) {
tradeFeeInBtcTextField.setOpacity(isCurrencyForMakerFeeBtc ? 1 : 0.3);
tradeFeeInBsqTextField.setOpacity(isCurrencyForMakerFeeBtc ? 0.3 : 1);
tradeFeeInBtcLabel.setOpacity(isCurrencyForMakerFeeBtc ? 1 : 0.3);
tradeFeeInBsqLabel.setOpacity(isCurrencyForMakerFeeBtc ? 0.3 : 1);
}
}
@ -972,7 +967,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
// we display either currencyComboBox (multi currency account) or currencyTextField (single)
currencyComboBox = currencyBoxTuple.third;
editOfferElements.add(currencySelection);
currencyComboBox.setConverter(new StringConverter<TradeCurrency>() {
currencyComboBox.setConverter(new StringConverter<>() {
@Override
public String toString(TradeCurrency tradeCurrency) {
return tradeCurrency.getNameAndCode();
@ -1001,7 +996,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
}
private void addAmountPriceGroup() {
amountTitledGroupBg = addTitledGroupBg(gridPane, ++gridRow, 2, Res.get("createOffer.setAmountPrice"), Layout.GROUP_DISTANCE);
amountTitledGroupBg = addTitledGroupBg(gridPane, ++gridRow, 2, Res.get("createOffer.setAmountPrice"), Layout.COMPACT_GROUP_DISTANCE);
GridPane.setColumnSpan(amountTitledGroupBg, 2);
addAmountPriceFields();
@ -1009,17 +1004,29 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
}
private void addOptionsGroup() {
setDepositTitledGroupBg = addTitledGroupBg(gridPane, ++gridRow, 2, Res.get("createOffer.setDeposit"), Layout.GROUP_DISTANCE);
setDepositTitledGroupBg = addTitledGroupBg(gridPane, ++gridRow, 2, Res.get("shared.advancedOptions"), Layout.COMPACT_GROUP_DISTANCE);
setDepositTitledGroupBg.getStyleClass().add("last");
addBuyerSecurityDepositRow();
advancedOptionsBox = new HBox();
advancedOptionsBox.setSpacing(40);
GridPane.setRowIndex(advancedOptionsBox, gridRow);
GridPane.setColumnIndex(advancedOptionsBox, 0);
GridPane.setHalignment(advancedOptionsBox, HPos.LEFT);
GridPane.setMargin(advancedOptionsBox, new Insets(Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE, 0, 0, 0));
gridPane.getChildren().add(advancedOptionsBox);
advancedOptionsBox.getChildren().addAll(getBuyerSecurityDepositBox(), getTradeFeeFieldsBox());
Tuple2<Button, Button> tuple = add2ButtonsAfterGroup(gridPane, ++gridRow,
Res.get("shared.nextStep"), Res.get("shared.cancel"));
nextButton = (AutoTooltipButton) tuple.first;
nextButton.setMaxWidth(200);
editOfferElements.add(nextButton);
nextButton.disableProperty().bind(model.isNextButtonDisabled);
cancelButton1 = (AutoTooltipButton) tuple.second;
cancelButton1.setMaxWidth(200);
editOfferElements.add(cancelButton1);
cancelButton1.setDefaultButton(false);
cancelButton1.setOnAction(e -> {
@ -1082,39 +1089,37 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
}
}
private void addBuyerSecurityDepositRow() {
final double top = model.getDataModel().isBsqForFeeAvailable() ? 0 : Layout.FIRST_ROW_AND_GROUP_DISTANCE;
private VBox getBuyerSecurityDepositBox() {
Tuple3<HBox, InputTextField, Label> tuple = getEditableValueBox(
Res.get("createOffer.securityDeposit.prompt"));
buyerSecurityDepositValueCurrencyBox = tuple.first;
buyerSecurityDepositInputTextField = tuple.second;
buyerSecurityDepositBtcLabel = tuple.third;
VBox depositBox = getTradeInputBox(tuple.first, Res.get("createOffer.setDeposit")).second;
depositBox.setMaxWidth(243);
editOfferElements.add(buyerSecurityDepositInputTextField);
editOfferElements.add(buyerSecurityDepositBtcLabel);
GridPane.setRowIndex(buyerSecurityDepositValueCurrencyBox, gridRow);
GridPane.setColumnIndex(buyerSecurityDepositValueCurrencyBox, 0);
GridPane.setHalignment(buyerSecurityDepositValueCurrencyBox, HPos.LEFT);
GridPane.setMargin(buyerSecurityDepositValueCurrencyBox, new Insets(top, 0, 0, 0));
gridPane.getChildren().add(buyerSecurityDepositValueCurrencyBox);
return depositBox;
}
private void addFundingGroup() {
// don't increase gridRow as we removed button when this gets visible
payFundsTitledGroupBg = addTitledGroupBg(gridPane, gridRow, 3,
Res.get("createOffer.fundsBox.title"), 0);
Res.get("createOffer.fundsBox.title"), Layout.COMPACT_GROUP_DISTANCE);
payFundsTitledGroupBg.getStyleClass().add("last");
GridPane.setColumnSpan(payFundsTitledGroupBg, 2);
payFundsTitledGroupBg.setVisible(false);
totalToPayTextField = addFundsTextfield(gridPane, gridRow,
Res.get("shared.totalsNeeded"), Layout.FIRST_ROW_DISTANCE);
Res.get("shared.totalsNeeded"), Layout.COMPACT_FIRST_ROW_AND_GROUP_DISTANCE);
totalToPayTextField.setVisible(false);
qrCodeImageView = new ImageView();
qrCodeImageView.setVisible(false);
qrCodeImageView.setFitHeight(150);
qrCodeImageView.setFitWidth(150);
qrCodeImageView.getStyleClass().add("qr-code");
Tooltip.install(qrCodeImageView, new Tooltip(Res.get("shared.openLargeQRWindow")));
qrCodeImageView.setOnMouseClicked(e -> GUIUtil.showFeeInfoBeforeExecute(
@ -1124,7 +1129,8 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
GridPane.setRowIndex(qrCodeImageView, gridRow);
GridPane.setColumnIndex(qrCodeImageView, 1);
GridPane.setRowSpan(qrCodeImageView, 3);
GridPane.setMargin(qrCodeImageView, new Insets(Layout.FIRST_ROW_DISTANCE - 9, 0, 0, 5));
GridPane.setValignment(qrCodeImageView, VPos.BOTTOM);
GridPane.setMargin(qrCodeImageView, new Insets(Layout.FIRST_ROW_DISTANCE - 9, 0, 0, 10));
gridPane.getChildren().add(qrCodeImageView);
addressTextField = addAddressTextField(gridPane, ++gridRow,
@ -1140,7 +1146,8 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
fundingHBox.setManaged(false);
fundingHBox.setSpacing(10);
Button fundFromSavingsWalletButton = new AutoTooltipButton(Res.get("shared.fundFromSavingsWalletButton"));
fundFromSavingsWalletButton.setDefaultButton(false);
fundFromSavingsWalletButton.setDefaultButton(true);
fundFromSavingsWalletButton.getStyleClass().add("action-button");
fundFromSavingsWalletButton.setOnAction(e -> model.fundFromSavingsWallet());
Label label = new AutoTooltipLabel(Res.get("shared.OR"));
label.setPadding(new Insets(5, 0, 0, 0));
@ -1154,18 +1161,16 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
fundingHBox.getChildren().addAll(fundFromSavingsWalletButton, label, fundFromExternalWalletButton, waitingForFundsBusyAnimation, waitingForFundsLabel);
GridPane.setRowIndex(fundingHBox, ++gridRow);
GridPane.setColumnIndex(fundingHBox, 0);
GridPane.setMargin(fundingHBox, new Insets(15, 10, 0, 0));
GridPane.setMargin(fundingHBox, new Insets(5, 0, 0, 0));
gridPane.getChildren().add(fundingHBox);
placeOfferBox = new HBox();
placeOfferBox.setSpacing(10);
GridPane.setRowIndex(placeOfferBox, gridRow);
GridPane.setMargin(placeOfferBox, new Insets(5, 20, 0, 0));
gridPane.getChildren().add(placeOfferBox);
placeOfferButton = new AutoTooltipButton();
GridPane.setColumnIndex(placeOfferButton, 0);
GridPane.setHalignment(placeOfferButton, HPos.LEFT);
placeOfferButton.setOnAction(e -> onPlaceOffer());
placeOfferButton.setMinHeight(40);
placeOfferButton.setPadding(new Insets(0, 20, 0, 20));
@ -1184,6 +1189,8 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
cancelButton2 = (AutoTooltipButton) addButton(gridPane, gridRow, Res.get("shared.cancel"));
GridPane.setColumnIndex(cancelButton2, 1);
GridPane.setHalignment(cancelButton2, HPos.LEFT);
GridPane.setMargin(cancelButton2, new Insets(5, 0, 0, 10));
;
cancelButton2.setOnAction(e -> {
if (model.getDataModel().getIsBtcWalletFunded().get()) {
new Popup<>().warning(Res.get("createOffer.warnCancelOffer"))
@ -1243,14 +1250,12 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
priceAsPercentageValueCurrencyBox = priceAsPercentageTuple.first;
marketBasedPriceInfoInputTextField = priceAsPercentageTuple.second;
marketBasedPriceTextField = marketBasedPriceInfoInputTextField.getInputTextField();
//marketBasedPriceTextField.setPrefWidth(200);
editOfferElements.add(marketBasedPriceTextField);
marketBasedPriceLabel = priceAsPercentageTuple.third;
editOfferElements.add(marketBasedPriceLabel);
Tuple2<Label, VBox> priceAsPercentageInputBoxTuple = getTradeInputBox(priceAsPercentageValueCurrencyBox,
Res.get("shared.distanceInPercent"));
percentagePriceDescription = priceAsPercentageInputBoxTuple.first;
//percentagePriceDescription.setPrefWidth(200);
getSmallIconForLabel(MaterialDesignIcon.CHART_LINE, percentagePriceDescription);
@ -1280,7 +1285,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
firstRowHBox.getChildren().addAll(amountBox, xLabel, percentagePriceBox, resultLabel, volumeBox);
GridPane.setRowIndex(firstRowHBox, gridRow);
GridPane.setColumnIndex(firstRowHBox, 0);
GridPane.setMargin(firstRowHBox, new Insets(Layout.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);
}
@ -1296,19 +1301,17 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
fixedPriceBox.setDisable(!fixedPriceSelected);
if (fixedPriceSelected) {
if (firstRowHBox.getChildren().contains(percentagePriceBox))
firstRowHBox.getChildren().remove(percentagePriceBox);
if (secondRowHBox.getChildren().contains(fixedPriceBox))
secondRowHBox.getChildren().remove(fixedPriceBox);
firstRowHBox.getChildren().remove(percentagePriceBox);
secondRowHBox.getChildren().remove(fixedPriceBox);
if (!firstRowHBox.getChildren().contains(fixedPriceBox))
firstRowHBox.getChildren().add(2, fixedPriceBox);
if (!secondRowHBox.getChildren().contains(percentagePriceBox))
secondRowHBox.getChildren().add(2, percentagePriceBox);
} else {
if (firstRowHBox.getChildren().contains(fixedPriceBox))
firstRowHBox.getChildren().remove(fixedPriceBox);
if (secondRowHBox.getChildren().contains(percentagePriceBox))
secondRowHBox.getChildren().remove(percentagePriceBox);
firstRowHBox.getChildren().remove(fixedPriceBox);
secondRowHBox.getChildren().remove(percentagePriceBox);
if (!firstRowHBox.getChildren().contains(percentagePriceBox))
firstRowHBox.getChildren().add(2, percentagePriceBox);
if (!secondRowHBox.getChildren().contains(fixedPriceBox))
@ -1356,40 +1359,33 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
editOfferElements.add(priceTypeToggleButton);
HBox.setMargin(priceTypeToggleButton, new Insets(16, 0, 0, 0));
priceTypeToggleButton.setOnAction((actionEvent) -> {
updatePriceToggleButtons(model.getDataModel().getUseMarketBasedPrice().getValue());
});
// Trade fee
setupTradeFeeFields();
priceTypeToggleButton.setOnAction((actionEvent) ->
updatePriceToggleButtons(model.getDataModel().getUseMarketBasedPrice().getValue()));
secondRowHBox = new HBox();
secondRowHBox.setSpacing(5);
secondRowHBox.setAlignment(Pos.CENTER_LEFT);
HBox.setMargin(tradeFeeBox, new Insets(0, 0, 0, 1));
secondRowHBox.getChildren().addAll(amountInputBoxTuple.second, fakeXLabel, fixedPriceBox, priceTypeToggleButton, tradeFeeBox);
secondRowHBox.getChildren().addAll(amountInputBoxTuple.second, fakeXLabel, fixedPriceBox, priceTypeToggleButton);
GridPane.setRowIndex(secondRowHBox, ++gridRow);
GridPane.setColumnIndex(secondRowHBox, 0);
GridPane.setMargin(secondRowHBox, new Insets(0, 10, 18, 0));
gridPane.getChildren().add(secondRowHBox);
}
private void setupTradeFeeFields() {
tradeFeeInBtcTextField = new TextField();
tradeFeeInBtcTextField.setMouseTransparent(true);
tradeFeeInBtcTextField.setId("trade-fee-textfield");
tradeFeeInBtcTextField.setPadding(new Insets(-6, 5, -8, 0));
private VBox getTradeFeeFieldsBox() {
tradeFeeInBtcLabel = new Label();
tradeFeeInBtcLabel.setMouseTransparent(true);
tradeFeeInBtcLabel.setId("trade-fee-textfield");
tradeFeeInBsqTextField = new TextField();
tradeFeeInBsqTextField.setMouseTransparent(true);
tradeFeeInBsqTextField.setId("trade-fee-textfield");
tradeFeeInBsqTextField.setPadding(new Insets(-9, 5, -7, 0));
tradeFeeInBsqLabel = new Label();
tradeFeeInBsqLabel.setMouseTransparent(true);
tradeFeeInBsqLabel.setId("trade-fee-textfield");
VBox vBox = new VBox();
vBox.setSpacing(6);
vBox.setMaxWidth(243);
vBox.getStyleClass().add("input-with-border");
vBox.getChildren().addAll(tradeFeeInBtcTextField, tradeFeeInBsqTextField);
vBox.setAlignment(Pos.CENTER_RIGHT);
vBox.getChildren().addAll(tradeFeeInBtcLabel, tradeFeeInBsqLabel);
tradeFeeInBtcToggle = new AutoTooltipSlideToggleButton();
tradeFeeInBtcToggle.setText("BTC");
@ -1402,10 +1398,6 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
VBox tradeFeeToggleButtonBox = new VBox();
tradeFeeToggleButtonBox.getChildren().addAll(tradeFeeInBtcToggle, tradeFeeInBsqToggle);
tradeFeeDescriptionLabel = new AutoTooltipLabel("Select trade fee currency");
tradeFeeDescriptionLabel.setId("input-description-label");
tradeFeeDescriptionLabel.setPrefWidth(170);
HBox hBox = new HBox();
hBox.getChildren().addAll(vBox, tradeFeeToggleButtonBox);
hBox.setMinHeight(47);
@ -1413,11 +1405,11 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel> extends
HBox.setHgrow(vBox, Priority.ALWAYS);
HBox.setHgrow(tradeFeeToggleButtonBox, Priority.NEVER);
tradeFeeBox = new VBox();
tradeFeeBox.setSpacing(2);
tradeFeeBox.getChildren().addAll(tradeFeeDescriptionLabel, hBox);
tradeFeeBox.setManaged(false);
tradeFeeBox.setVisible(false);
final Tuple2<Label, VBox> tradeInputBox = getTradeInputBox(hBox, Res.get("createOffer.tradeFee.descriptionBSQEnabled"));
tradeFeeDescriptionLabel = tradeInputBox.first;
return tradeInputBox.second;
}

View File

@ -836,11 +836,13 @@ public abstract class Overlay<T extends Overlay> {
protected void addCloseButton() {
if (!hideCloseButton) {
closeButton = new AutoTooltipButton(closeButtonText == null ? Res.get("shared.close") : closeButtonText);
closeButton.getStyleClass().add("compact-button");
closeButton.setOnAction(event -> doClose());
}
if (actionHandlerOptional.isPresent() || actionButtonText != null) {
actionButton = new AutoTooltipButton(actionButtonText == null ? Res.get("shared.ok") : actionButtonText);
actionButton.setDefaultButton(true);
actionButton.getStyleClass().add("action-button");
//TODO app wide focus
//actionButton.requestFocus();
actionButton.setOnAction(event -> {
@ -852,7 +854,7 @@ public abstract class Overlay<T extends Overlay> {
HBox hBox = new HBox();
hBox.setSpacing(10);
if (!hideCloseButton)
hBox.getChildren().addAll(spacer, closeButton, actionButton);
hBox.getChildren().addAll(spacer, actionButton, closeButton);
else
hBox.getChildren().addAll(spacer, actionButton);
HBox.setHgrow(spacer, Priority.ALWAYS);

View File

@ -1437,7 +1437,6 @@ public class FormBuilder {
HBox.setHgrow(input, Priority.ALWAYS);
input.setMaxWidth(Double.MAX_VALUE);
box.getStyleClass().add("input-with-border");
//box.setMaxWidth(243);
box.getChildren().addAll(input, label);
return new Tuple3<>(box, input, label);
}
@ -1454,7 +1453,6 @@ public class FormBuilder {
HBox.setHgrow(infoInputTextField, Priority.ALWAYS);
infoInputTextField.setMaxWidth(Double.MAX_VALUE);
box.getStyleClass().add("input-with-border");
//box.setMaxWidth(243);
box.getChildren().addAll(infoInputTextField, label);
return new Tuple3<>(box, infoInputTextField, label);
}
@ -1511,16 +1509,13 @@ public class FormBuilder {
// Trade: Label, VBox
///////////////////////////////////////////////////////////////////////////////////////////
public static Tuple2<Label, VBox> getTradeInputBox(HBox amountValueBox) {
return getTradeInputBox(amountValueBox, "");
}
public static Tuple2<Label, VBox> getTradeInputBox(HBox amountValueBox, String descriptionText) {
public static Tuple2<Label, VBox> getTradeInputBox(Pane amountValueBox, String descriptionText) {
Label descriptionLabel = new AutoTooltipLabel(descriptionText);
descriptionLabel.setId("input-description-label");
descriptionLabel.setPrefWidth(170);
VBox box = new VBox();
box.setPadding(new Insets(10, 0, 0, 0));
box.setSpacing(2);
box.getChildren().addAll(descriptionLabel, amountValueBox);
return new Tuple2<>(descriptionLabel, box);

View File

@ -24,7 +24,9 @@ public class Layout {
public static final double TWICE_FIRST_ROW_DISTANCE = 20d * 2;
public static final double FLOATING_LABEL_DISTANCE = 20d;
public static final double GROUP_DISTANCE = 40d;
public static final double COMPACT_GROUP_DISTANCE = 30d;
public static final double FIRST_ROW_AND_GROUP_DISTANCE = GROUP_DISTANCE + FIRST_ROW_DISTANCE;
public static final double COMPACT_FIRST_ROW_AND_GROUP_DISTANCE = COMPACT_GROUP_DISTANCE + FIRST_ROW_DISTANCE;
public static final double TWICE_FIRST_ROW_AND_GROUP_DISTANCE = GROUP_DISTANCE + TWICE_FIRST_ROW_DISTANCE;
public static final double PADDING_WINDOW = 20d;
public static double PADDING = 10d;