From 2ead91c961925902323a09f2862a319118bfbe24 Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Tue, 1 Dec 2020 18:02:23 -0500 Subject: [PATCH 1/6] Increase height of account list when account is selected to make scrolling easier. --- .../content/altcoinaccounts/AltCoinAccountsDataModel.java | 4 ++++ .../account/content/altcoinaccounts/AltCoinAccountsView.java | 3 ++- .../account/content/fiataccounts/FiatAccountsDataModel.java | 4 ++++ .../main/account/content/fiataccounts/FiatAccountsView.java | 3 ++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/account/content/altcoinaccounts/AltCoinAccountsDataModel.java b/desktop/src/main/java/bisq/desktop/main/account/content/altcoinaccounts/AltCoinAccountsDataModel.java index 7115e9097b4..04883b53aca 100644 --- a/desktop/src/main/java/bisq/desktop/main/account/content/altcoinaccounts/AltCoinAccountsDataModel.java +++ b/desktop/src/main/java/bisq/desktop/main/account/content/altcoinaccounts/AltCoinAccountsDataModel.java @@ -157,4 +157,8 @@ public void exportAccounts(Stage stage) { public void importAccounts(Stage stage) { GUIUtil.importAccounts(user, accountsFileName, preferences, stage, persistenceProtoResolver, corruptedStorageFileHandler); } + + public int getNumPaymentAccounts() { + return user.getPaymentAccounts() != null ? user.getPaymentAccounts().size() : 0; + } } diff --git a/desktop/src/main/java/bisq/desktop/main/account/content/altcoinaccounts/AltCoinAccountsView.java b/desktop/src/main/java/bisq/desktop/main/account/content/altcoinaccounts/AltCoinAccountsView.java index 02985f77a58..258dfb9dfa1 100644 --- a/desktop/src/main/java/bisq/desktop/main/account/content/altcoinaccounts/AltCoinAccountsView.java +++ b/desktop/src/main/java/bisq/desktop/main/account/content/altcoinaccounts/AltCoinAccountsView.java @@ -177,7 +177,8 @@ protected void buildForm() { Tuple3, VBox> tuple = addTopLabelListView(root, gridRow, Res.get("account.altcoin.yourAltcoinAccounts"), Layout.FIRST_ROW_DISTANCE); paymentAccountsListView = tuple.second; - paymentAccountsListView.setMinHeight(2 * Layout.LIST_ROW_HEIGHT + 14); + int prefNumRows = Math.min(4, Math.max(2, model.dataModel.getNumPaymentAccounts())); + paymentAccountsListView.setMinHeight(prefNumRows * Layout.LIST_ROW_HEIGHT + 28); setPaymentAccountsCellFactory(); Tuple3 tuple3 = add3ButtonsAfterGroup(root, ++gridRow, Res.get("shared.addNewAccount"), diff --git a/desktop/src/main/java/bisq/desktop/main/account/content/fiataccounts/FiatAccountsDataModel.java b/desktop/src/main/java/bisq/desktop/main/account/content/fiataccounts/FiatAccountsDataModel.java index 319f5f4e316..0a45a883847 100644 --- a/desktop/src/main/java/bisq/desktop/main/account/content/fiataccounts/FiatAccountsDataModel.java +++ b/desktop/src/main/java/bisq/desktop/main/account/content/fiataccounts/FiatAccountsDataModel.java @@ -160,4 +160,8 @@ public void exportAccounts(Stage stage) { public void importAccounts(Stage stage) { GUIUtil.importAccounts(user, accountsFileName, preferences, stage, persistenceProtoResolver, corruptedStorageFileHandler); } + + public int getNumPaymentAccounts() { + return user.getPaymentAccounts() != null ? user.getPaymentAccounts().size() : 0; + } } diff --git a/desktop/src/main/java/bisq/desktop/main/account/content/fiataccounts/FiatAccountsView.java b/desktop/src/main/java/bisq/desktop/main/account/content/fiataccounts/FiatAccountsView.java index d837db01ce5..656dbba02ba 100644 --- a/desktop/src/main/java/bisq/desktop/main/account/content/fiataccounts/FiatAccountsView.java +++ b/desktop/src/main/java/bisq/desktop/main/account/content/fiataccounts/FiatAccountsView.java @@ -362,7 +362,8 @@ protected void buildForm() { Tuple3, VBox> tuple = addTopLabelListView(root, gridRow, Res.get("account.fiat.yourFiatAccounts"), Layout.FIRST_ROW_DISTANCE); paymentAccountsListView = tuple.second; - paymentAccountsListView.setMinHeight(2 * Layout.LIST_ROW_HEIGHT + 14); + int prefNumRows = Math.min(4, Math.max(2, model.dataModel.getNumPaymentAccounts())); + paymentAccountsListView.setMinHeight(prefNumRows * Layout.LIST_ROW_HEIGHT + 28); setPaymentAccountsCellFactory(); Tuple3 tuple3 = add3ButtonsAfterGroup(root, ++gridRow, Res.get("shared.addNewAccount"), From bd736be95684fe27a7f00ebd233828fe9b1d1974 Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Tue, 1 Dec 2020 18:04:46 -0500 Subject: [PATCH 2/6] Use full width for altcoin accounts view (as it was already in fiat accounts) --- .../account/content/altcoinaccounts/AltCoinAccountsView.fxml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/src/main/java/bisq/desktop/main/account/content/altcoinaccounts/AltCoinAccountsView.fxml b/desktop/src/main/java/bisq/desktop/main/account/content/altcoinaccounts/AltCoinAccountsView.fxml index eadf139d7f7..0d2efd9cad1 100644 --- a/desktop/src/main/java/bisq/desktop/main/account/content/altcoinaccounts/AltCoinAccountsView.fxml +++ b/desktop/src/main/java/bisq/desktop/main/account/content/altcoinaccounts/AltCoinAccountsView.fxml @@ -31,6 +31,6 @@ - + From 2411f2d9c8d52303c6581b2fc4d0501312819d2f Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Tue, 1 Dec 2020 18:16:23 -0500 Subject: [PATCH 3/6] Use setMinHeight instead of setPrefHeight for textArea in F2FForm and USPostalMoneyOrderForm and sue 70 px for both --- .../bisq/desktop/components/paymentmethods/F2FForm.java | 6 +++--- .../components/paymentmethods/USPostalMoneyOrderForm.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/F2FForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/F2FForm.java index 6f2e7a8613f..431662a5808 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/F2FForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/F2FForm.java @@ -65,7 +65,7 @@ public static int addFormForBuyer(GridPane gridPane, int gridRow, addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.f2f.contact"), f2fAccountPayload.getContact()); TextArea textArea = addTopLabelTextArea(gridPane, gridRow, 1, Res.get("payment.f2f.extra"), "").second; - textArea.setPrefHeight(60); + textArea.setMinHeight(70); textArea.setEditable(false); textArea.setId("text-area-disabled"); textArea.setText(offer.getF2FExtraInfo()); @@ -110,7 +110,7 @@ public void addFormForAddAccount() { TextArea extraTextArea = addTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.f2f.optionalExtra"), Res.get("payment.f2f.extra.prompt")).second; - extraTextArea.setPrefHeight(60); + extraTextArea.setMinHeight(70); ((JFXTextArea) extraTextArea).setLabelFloat(false); //extraTextArea.setValidator(f2fValidator); extraTextArea.textProperty().addListener((ov, oldValue, newValue) -> { @@ -165,7 +165,7 @@ public void addFormForDisplayAccount() { f2fAccount.getCity()); TextArea textArea = addCompactTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.f2f.extra"), "").second; textArea.setText(f2fAccount.getExtraInfo()); - textArea.setPrefHeight(60); + textArea.setMinHeight(70); textArea.setEditable(false); addLimitations(true); diff --git a/desktop/src/main/java/bisq/desktop/components/paymentmethods/USPostalMoneyOrderForm.java b/desktop/src/main/java/bisq/desktop/components/paymentmethods/USPostalMoneyOrderForm.java index 601cccc1858..dc51aaca3cf 100644 --- a/desktop/src/main/java/bisq/desktop/components/paymentmethods/USPostalMoneyOrderForm.java +++ b/desktop/src/main/java/bisq/desktop/components/paymentmethods/USPostalMoneyOrderForm.java @@ -47,7 +47,7 @@ public static int addFormForBuyer(GridPane gridPane, int gridRow, addCompactTopLabelTextFieldWithCopyIcon(gridPane, ++gridRow, Res.get("payment.account.owner"), ((USPostalMoneyOrderAccountPayload) paymentAccountPayload).getHolderName()); TextArea textArea = addCompactTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.postal.address"), "").second; - textArea.setPrefHeight(70); + textArea.setMinHeight(70); textArea.setEditable(false); textArea.setId("text-area-disabled"); textArea.setText(((USPostalMoneyOrderAccountPayload) paymentAccountPayload).getPostalAddress()); @@ -76,7 +76,7 @@ public void addFormForAddAccount() { postalAddressTextArea = addTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.postal.address"), "").second; - postalAddressTextArea.setPrefHeight(70); + postalAddressTextArea.setMinHeight(70); //postalAddressTextArea.setValidator(usPostalMoneyOrderValidator); postalAddressTextArea.textProperty().addListener((ov, oldValue, newValue) -> { usPostalMoneyOrderAccount.setPostalAddress(newValue); @@ -108,7 +108,7 @@ public void addFormForDisplayAccount() { usPostalMoneyOrderAccount.getHolderName()); TextArea textArea = addCompactTopLabelTextArea(gridPane, ++gridRow, Res.get("payment.postal.address"), "").second; textArea.setText(usPostalMoneyOrderAccount.getPostalAddress()); - textArea.setPrefHeight(70); + textArea.setMinHeight(70); textArea.setEditable(false); TradeCurrency singleTradeCurrency = usPostalMoneyOrderAccount.getSingleTradeCurrency(); String nameAndCode = singleTradeCurrency != null ? singleTradeCurrency.getNameAndCode() : "null"; From c1e702c5070a71d6f77bd24ba1475ba12795f978 Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Tue, 1 Dec 2020 18:20:51 -0500 Subject: [PATCH 4/6] Remove BUYER_SECURITY_DEPOSIT_NEWS (was used in 0.9.5) --- .../main/java/bisq/desktop/main/offer/MutableOfferView.java | 1 - desktop/src/main/java/bisq/desktop/main/offer/OfferView.java | 4 ---- 2 files changed, 5 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java index 728df596edd..c8d081f6a8d 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java @@ -122,7 +122,6 @@ import static javafx.beans.binding.Bindings.createStringBinding; public abstract class MutableOfferView> extends ActivatableViewAndModel { - public static final String BUYER_SECURITY_DEPOSIT_NEWS = "buyerSecurityDepositNews0.9.5"; protected final Navigation navigation; private final Preferences preferences; private final OfferDetailsWindow offerDetailsWindow; diff --git a/desktop/src/main/java/bisq/desktop/main/offer/OfferView.java b/desktop/src/main/java/bisq/desktop/main/offer/OfferView.java index fbfc38c31de..be6f209f0f9 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/OfferView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/OfferView.java @@ -53,8 +53,6 @@ import java.util.Optional; import java.util.stream.Collectors; -import static bisq.desktop.main.offer.MutableOfferView.BUYER_SECURITY_DEPOSIT_NEWS; - public abstract class OfferView extends ActivatableView { private OfferBookView offerBookView; @@ -273,8 +271,6 @@ private void onCreateOfferViewRemoved() { offerBookView.enableCreateOfferButton(); navigation.navigateTo(MainView.class, this.getClass(), OfferBookView.class); - - preferences.dontShowAgain(BUYER_SECURITY_DEPOSIT_NEWS, true); } private void onTakeOfferViewRemoved() { From 9a5ffeecb3f257700d2dbbd6b5a9c4b203fb642d Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Tue, 1 Dec 2020 18:21:50 -0500 Subject: [PATCH 5/6] Remove unused method --- .../main/java/bisq/desktop/main/offer/MutableOfferView.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java index c8d081f6a8d..42383292f03 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java @@ -1037,12 +1037,6 @@ public TradeCurrency fromString(String s) { paymentGroupBox.getChildren().add(currencyTextFieldBox); } - protected void hidePaymentGroup() { - paymentTitledGroupBg.setVisible(false); - paymentGroupBox.setManaged(false); - paymentGroupBox.setVisible(false); - } - private void addAmountPriceGroup() { amountTitledGroupBg = addTitledGroupBg(gridPane, ++gridRow, 2, Res.get("createOffer.setAmountPrice"), Layout.COMPACT_GROUP_DISTANCE); From eb40c777ee77b48a94ed8e5152b7370dd52d1ee5 Mon Sep 17 00:00:00 2001 From: chimp1984 Date: Tue, 1 Dec 2020 18:42:43 -0500 Subject: [PATCH 6/6] Make paymentGroupBox local --- .../java/bisq/desktop/main/offer/MutableOfferView.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java index 42383292f03..e02dd6e5ae6 100644 --- a/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java +++ b/desktop/src/main/java/bisq/desktop/main/offer/MutableOfferView.java @@ -135,8 +135,7 @@ public abstract class MutableOfferView> exten private BusyAnimation waitingForFundsSpinner; private AutoTooltipButton nextButton, cancelButton1, cancelButton2, placeOfferButton; private Button priceTypeToggleButton; - private InputTextField fixedPriceTextField; - private InputTextField marketBasedPriceTextField; + private InputTextField fixedPriceTextField, marketBasedPriceTextField; protected InputTextField amountTextField, minAmountTextField, volumeTextField, buyerSecurityDepositInputTextField; private TextField currencyTextField; private AddressTextField addressTextField; @@ -154,7 +153,7 @@ public abstract class MutableOfferView> exten currencyTextFieldBox; private HBox fundingHBox, firstRowHBox, secondRowHBox, placeOfferBox, amountValueCurrencyBox, priceAsPercentageValueCurrencyBox, volumeValueCurrencyBox, priceValueCurrencyBox, - minAmountValueCurrencyBox, advancedOptionsBox, paymentGroupBox; + minAmountValueCurrencyBox, advancedOptionsBox; private Subscription isWaitingForFundsSubscription, balanceSubscription; private ChangeListener amountFocusedListener, minAmountFocusedListener, volumeFocusedListener, @@ -988,7 +987,7 @@ private void addPaymentGroup() { paymentTitledGroupBg = addTitledGroupBg(gridPane, gridRow, 1, Res.get("shared.selectTradingAccount")); GridPane.setColumnSpan(paymentTitledGroupBg, 2); - paymentGroupBox = new HBox(); + HBox paymentGroupBox = new HBox(); paymentGroupBox.setAlignment(Pos.CENTER_LEFT); paymentGroupBox.setSpacing(12); paymentGroupBox.setPadding(new Insets(10, 0, 18, 0));