From 31fb52721888bfd8c3017c67bcd3cad5f88d252b Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Mon, 12 Apr 2021 09:16:49 +0200 Subject: [PATCH] color transaction values which deduct from wallet balance in red --- .../java/com/sparrowwallet/sparrow/control/CoinCell.java | 4 ++++ .../java/com/sparrowwallet/sparrow/control/EntryCell.java | 1 + .../resources/com/sparrowwallet/sparrow/darktheme.css | 4 ++++ .../resources/com/sparrowwallet/sparrow/wallet/wallet.css | 8 ++++++++ 4 files changed, 17 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/control/CoinCell.java b/src/main/java/com/sparrowwallet/sparrow/control/CoinCell.java index 120ee953..ee79855f 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/CoinCell.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/CoinCell.java @@ -66,6 +66,10 @@ class CoinCell extends TreeTableCell { } else { setGraphic(null); } + + if(amount.longValue() < 0) { + getStyleClass().add("negative-amount"); + } } else if(entry instanceof UtxoEntry) { setGraphic(null); } else if(entry instanceof HashIndexEntry) { diff --git a/src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java b/src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java index 5abefe4b..747d4a83 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java @@ -416,6 +416,7 @@ public class EntryCell extends TreeTableCell { cell.getStyleClass().remove("address-cell"); cell.getStyleClass().remove("hashindex-row"); cell.getStyleClass().remove("confirming"); + cell.getStyleClass().remove("negative-amount"); cell.getStyleClass().remove("spent"); cell.getStyleClass().remove("unspendable"); diff --git a/src/main/resources/com/sparrowwallet/sparrow/darktheme.css b/src/main/resources/com/sparrowwallet/sparrow/darktheme.css index 18e8760e..c4402ba1 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/darktheme.css +++ b/src/main/resources/com/sparrowwallet/sparrow/darktheme.css @@ -110,6 +110,10 @@ -fx-text-fill: #e06c75; } +.root .coin-cell.negative-amount { + -fx-text-fill: #e09499; +} + .root .etched-raised-border { -fx-border-color: #ffffff, #000000; -fx-border-style: solid, solid; diff --git a/src/main/resources/com/sparrowwallet/sparrow/wallet/wallet.css b/src/main/resources/com/sparrowwallet/sparrow/wallet/wallet.css index 13462955..ce4e516e 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/wallet/wallet.css +++ b/src/main/resources/com/sparrowwallet/sparrow/wallet/wallet.css @@ -75,6 +75,14 @@ -fx-padding: 0 8 0 0; } +.coin-cell.negative-amount { + -fx-text-fill: rgb(202, 18, 67); +} + +.tree-table-row-cell:selected .coin-cell.negative-amount { + -fx-text-fill: white; +} + .confirmation-progress-circle, .confirmation-progress-tick { -fx-stroke: -fx-text-base-color; }