diff --git a/gui/src/main/java/io/bisq/gui/bisq.css b/gui/src/main/java/io/bisq/gui/bisq.css index 3f44272a01..e500b2a0ee 100644 --- a/gui/src/main/java/io/bisq/gui/bisq.css +++ b/gui/src/main/java/io/bisq/gui/bisq.css @@ -177,6 +177,11 @@ bg color of non edit textFields: fafafa .warning { -fx-text-fill: -bs-yellow; } + +.zero-decimals { + -fx-fill: -bs-light-grey; +} + /* Other UI Elements */ .separator { diff --git a/gui/src/main/java/io/bisq/gui/components/ColoredDecimalPlacesWithZerosText.java b/gui/src/main/java/io/bisq/gui/components/ColoredDecimalPlacesWithZerosText.java new file mode 100644 index 0000000000..870c905dc7 --- /dev/null +++ b/gui/src/main/java/io/bisq/gui/components/ColoredDecimalPlacesWithZerosText.java @@ -0,0 +1,22 @@ +package io.bisq.gui.components; + +import javafx.scene.text.Text; +import javafx.scene.text.TextAlignment; +import javafx.scene.text.TextFlow; + +public class ColoredDecimalPlacesWithZerosText extends TextFlow { + + public ColoredDecimalPlacesWithZerosText(String number) { + super(); + + String placesBeforeZero = number.split("0*$")[0]; + String zeroDecimalPlaces = number.substring(placesBeforeZero.length()); + Text first = new Text(placesBeforeZero); + Text last = new Text(zeroDecimalPlaces); + last.getStyleClass().add("zero-decimals"); + setTextAlignment(TextAlignment.CENTER); + setPrefHeight(20); + + getChildren().addAll(first, last); + } +} diff --git a/gui/src/main/java/io/bisq/gui/main/market/offerbook/OfferBookChartView.java b/gui/src/main/java/io/bisq/gui/main/market/offerbook/OfferBookChartView.java index 7c2da0e4ea..4b1f4fa302 100644 --- a/gui/src/main/java/io/bisq/gui/main/market/offerbook/OfferBookChartView.java +++ b/gui/src/main/java/io/bisq/gui/main/market/offerbook/OfferBookChartView.java @@ -29,6 +29,7 @@ import io.bisq.gui.common.view.FxmlView; import io.bisq.gui.components.AutoTooltipButton; import io.bisq.gui.components.AutoTooltipLabel; import io.bisq.gui.components.AutoTooltipTableColumn; +import io.bisq.gui.components.ColoredDecimalPlacesWithZerosText; import io.bisq.gui.main.MainView; import io.bisq.gui.main.offer.BuyOfferView; import io.bisq.gui.main.offer.SellOfferView; @@ -54,6 +55,10 @@ import javafx.scene.image.ImageView; import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; import javafx.scene.layout.VBox; +import javafx.scene.paint.Color; +import javafx.scene.text.Text; +import javafx.scene.text.TextAlignment; +import javafx.scene.text.TextFlow; import javafx.util.Callback; import javafx.util.StringConverter; import org.fxmisc.easybind.EasyBind; @@ -410,8 +415,9 @@ public class OfferBookChartView extends ActivatableViewAndModel