mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-08-02 03:36:24 -04:00
do not color currency code in offer book volume column
This commit is contained in:
parent
b289a256ee
commit
8cca2cbb52
2 changed files with 12 additions and 3 deletions
|
@ -946,8 +946,9 @@ abstract public class OfferBookView<R extends GridPane, M extends OfferBookViewM
|
|||
setGraphic(null);
|
||||
} else {
|
||||
setText("");
|
||||
setGraphic(new ColoredDecimalPlacesWithZerosText(model.getVolume(item),
|
||||
model.getNumberOfDecimalsForVolume(item)));
|
||||
ColoredDecimalPlacesWithZerosText volumeBox = new ColoredDecimalPlacesWithZerosText(model.getVolumeAmount(item), model.getNumberOfDecimalsForVolume(item));
|
||||
if (model.showAllTradeCurrenciesProperty.get()) volumeBox.getChildren().add(new Label(" " + item.getOffer().getCurrencyCode()));
|
||||
setGraphic(volumeBox);
|
||||
}
|
||||
} else {
|
||||
setText("");
|
||||
|
|
|
@ -436,11 +436,19 @@ abstract class OfferBookViewModel extends ActivatableViewModel {
|
|||
return formatVolume(item.getOffer(), true);
|
||||
}
|
||||
|
||||
String getVolumeAmount(OfferBookListItem item) {
|
||||
return formatVolume(item.getOffer(), true, false);
|
||||
}
|
||||
|
||||
private String formatVolume(Offer offer, boolean decimalAligned) {
|
||||
return formatVolume(offer, decimalAligned, showAllTradeCurrenciesProperty.get());
|
||||
}
|
||||
|
||||
private String formatVolume(Offer offer, boolean decimalAligned, boolean appendCurrencyCode) {
|
||||
Volume offerVolume = offer.getVolume();
|
||||
Volume minOfferVolume = offer.getMinVolume();
|
||||
if (offerVolume != null && minOfferVolume != null) {
|
||||
String postFix = showAllTradeCurrenciesProperty.get() ? " " + offer.getCurrencyCode() : "";
|
||||
String postFix = appendCurrencyCode ? " " + offer.getCurrencyCode() : "";
|
||||
decimalAligned = decimalAligned && !showAllTradeCurrenciesProperty.get();
|
||||
return VolumeUtil.formatVolume(offer, decimalAligned, maxPlacesForVolume.get()) + postFix;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue