Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align Altcoin list with Altcoin selection combobox #7

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import bisq.desktop.components.PasswordTextField;
import bisq.desktop.components.TitledGroupBg;
import bisq.desktop.main.overlays.popups.Popup;
import bisq.desktop.util.FormBuilder;
import bisq.desktop.util.GUIUtil;
import bisq.desktop.util.ImageUtil;
import bisq.desktop.util.Layout;
Expand Down Expand Up @@ -87,7 +86,6 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

import static bisq.desktop.util.FormBuilder.*;

Expand Down Expand Up @@ -230,13 +228,13 @@ public BaseCurrencyNetwork fromString(String string) {
}
});*/

userLanguageComboBox = FormBuilder.addComboBox(root, gridRow,
userLanguageComboBox = addComboBox(root, gridRow,
Res.get("shared.language"), Layout.FIRST_ROW_DISTANCE);
userCountryComboBox = FormBuilder.addComboBox(root, ++gridRow,
userCountryComboBox = addComboBox(root, ++gridRow,
Res.get("shared.country"));
userCountryComboBox.setButtonCell(GUIUtil.getComboBoxButtonCell(Res.get("shared.country"), userCountryComboBox,
false));
blockChainExplorerComboBox = FormBuilder.addComboBox(root, ++gridRow,
blockChainExplorerComboBox = addComboBox(root, ++gridRow,
Res.get("setting.preferences.explorer"));
blockChainExplorerComboBox.setButtonCell(GUIUtil.getComboBoxButtonCell(Res.get("setting.preferences.explorer"),
blockChainExplorerComboBox, false));
Expand Down Expand Up @@ -345,12 +343,15 @@ private void initializeSeparator() {

private void initializeDisplayCurrencies() {
int displayCurrenciesGridRowIndex = 0;
TitledGroupBg titledGroupBg = addTitledGroupBg(root, displayCurrenciesGridRowIndex, 9, Res.get("setting.preferences.currenciesInList"));

TitledGroupBg titledGroupBg = addTitledGroupBg(root, displayCurrenciesGridRowIndex, 9,
Res.get("setting.preferences.currenciesInList"));
GridPane.setColumnIndex(titledGroupBg, 2);
GridPane.setColumnSpan(titledGroupBg, 2);


preferredTradeCurrencyComboBox = FormBuilder.addComboBox(root, displayCurrenciesGridRowIndex++, Res.get("setting.preferences.prefCurrency"),
preferredTradeCurrencyComboBox = addComboBox(root, displayCurrenciesGridRowIndex++,
Res.get("setting.preferences.prefCurrency"),
Layout.FIRST_ROW_DISTANCE);
GridPane.setColumnIndex(preferredTradeCurrencyComboBox, 2);

Expand All @@ -371,7 +372,8 @@ public TradeCurrency fromString(String string) {
preferredTradeCurrencyComboBox.setCellFactory(GUIUtil.getTradeCurrencyCellFactory("", "",
Collections.emptyMap()));

Tuple3<Label, ListView<FiatCurrency>, VBox> fiatTuple = FormBuilder.addTopLabelListView(root, displayCurrenciesGridRowIndex, Res.get("setting.preferences.displayFiat"));
Tuple3<Label, ListView<FiatCurrency>, VBox> fiatTuple = addTopLabelListView(root, displayCurrenciesGridRowIndex,
Res.get("setting.preferences.displayFiat"));

int listRowSpan = 6;
GridPane.setColumnIndex(fiatTuple.third, 2);
Expand Down Expand Up @@ -426,7 +428,8 @@ public void updateItem(final FiatCurrency item, boolean empty) {
}
});

Tuple3<Label, ListView<CryptoCurrency>, VBox> cryptoCurrenciesTuple = FormBuilder.addTopLabelListView(root, displayCurrenciesGridRowIndex, Res.get("setting.preferences.displayAltcoins"));
Tuple3<Label, ListView<CryptoCurrency>, VBox> cryptoCurrenciesTuple = addTopLabelListView(root,
displayCurrenciesGridRowIndex, Res.get("setting.preferences.displayAltcoins"));

GridPane.setColumnIndex(cryptoCurrenciesTuple.third, 3);
GridPane.setRowSpan(cryptoCurrenciesTuple.third, listRowSpan);
Expand Down Expand Up @@ -480,7 +483,7 @@ public void updateItem(final CryptoCurrency item, boolean empty) {
}
});

fiatCurrenciesComboBox = FormBuilder.addComboBox(root, displayCurrenciesGridRowIndex + listRowSpan);
fiatCurrenciesComboBox = addComboBox(root, displayCurrenciesGridRowIndex + listRowSpan);
GridPane.setColumnIndex(fiatCurrenciesComboBox, 2);
GridPane.setValignment(fiatCurrenciesComboBox, VPos.TOP);
fiatCurrenciesComboBox.setPromptText(Res.get("setting.preferences.addFiat"));
Expand Down Expand Up @@ -509,9 +512,11 @@ public FiatCurrency fromString(String s) {
}
});

cryptoCurrenciesComboBox = FormBuilder.addComboBox(root, displayCurrenciesGridRowIndex + listRowSpan);
cryptoCurrenciesComboBox = addComboBox(root, displayCurrenciesGridRowIndex + listRowSpan);
GridPane.setColumnIndex(cryptoCurrenciesComboBox, 3);
GridPane.setValignment(cryptoCurrenciesComboBox, VPos.TOP);
GridPane.setMargin(cryptoCurrenciesComboBox, new Insets(Layout.FLOATING_LABEL_DISTANCE,
0, 0, 20));
cryptoCurrenciesComboBox.setPromptText(Res.get("setting.preferences.addAltcoin"));
cryptoCurrenciesComboBox.setButtonCell(new ListCell<>() {
@Override
Expand Down Expand Up @@ -602,7 +607,7 @@ private void activateGeneralOptions() {
}

transactionFeeInputTextField.setText(String.valueOf(getTxFeeForWithdrawalPerByte()));
ignoreTradersListInputTextField.setText(preferences.getIgnoreTradersList().stream().collect(Collectors.joining(", ")));
ignoreTradersListInputTextField.setText(String.join(", ", preferences.getIgnoreTradersList()));
referralIdService.getOptionalReferralId().ifPresent(referralId -> referralIdInputTextField.setText(referralId));
referralIdInputTextField.setPromptText(Res.get("setting.preferences.refererId.prompt"));
userLanguageComboBox.setItems(languageCodes);
Expand Down