Skip to content

Commit

Permalink
Merge pull request #4914 from chimp1984/ui-improvements
Browse files Browse the repository at this point in the history
UI improvements
  • Loading branch information
ripcurlx committed Dec 9, 2020
2 parents 933ed9f + eb40c77 commit a340a83
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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) -> {
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0"/>
</padding>
<columnConstraints>
<ColumnConstraints hgrow="NEVER" minWidth="300.0"/>
<ColumnConstraints hgrow="ALWAYS" minWidth="300.0"/>
</columnConstraints>
</GridPane>
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ protected void buildForm() {

Tuple3<Label, ListView<PaymentAccount>, 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<Button, Button, Button> tuple3 = add3ButtonsAfterGroup(root, ++gridRow, Res.get("shared.addNewAccount"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@ protected void buildForm() {

Tuple3<Label, ListView<PaymentAccount>, 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<Button, Button, Button> tuple3 = add3ButtonsAfterGroup(root, ++gridRow, Res.get("shared.addNewAccount"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
import static javafx.beans.binding.Bindings.createStringBinding;

public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> extends ActivatableViewAndModel<AnchorPane, M> {
public static final String BUYER_SECURITY_DEPOSIT_NEWS = "buyerSecurityDepositNews0.9.5";
protected final Navigation navigation;
private final Preferences preferences;
private final OfferDetailsWindow offerDetailsWindow;
Expand All @@ -136,8 +135,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> 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;
Expand All @@ -155,7 +153,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> exten
currencyTextFieldBox;
private HBox fundingHBox, firstRowHBox, secondRowHBox, placeOfferBox, amountValueCurrencyBox,
priceAsPercentageValueCurrencyBox, volumeValueCurrencyBox, priceValueCurrencyBox,
minAmountValueCurrencyBox, advancedOptionsBox, paymentGroupBox;
minAmountValueCurrencyBox, advancedOptionsBox;

private Subscription isWaitingForFundsSubscription, balanceSubscription;
private ChangeListener<Boolean> amountFocusedListener, minAmountFocusedListener, volumeFocusedListener,
Expand Down Expand Up @@ -989,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));
Expand Down Expand Up @@ -1038,12 +1036,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);
Expand Down
4 changes: 0 additions & 4 deletions desktop/src/main/java/bisq/desktop/main/offer/OfferView.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<TabPane, Void> {

private OfferBookView offerBookView;
Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit a340a83

Please sign in to comment.