diff --git a/src/main/java/com/sparrowwallet/sparrow/control/DateCell.java b/src/main/java/com/sparrowwallet/sparrow/control/DateCell.java index 45806baa..d974ca23 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/DateCell.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/DateCell.java @@ -1,6 +1,5 @@ package com.sparrowwallet.sparrow.control; -import com.sparrowwallet.drongo.wallet.BlockTransactionHashIndex; import com.sparrowwallet.sparrow.wallet.Entry; import com.sparrowwallet.sparrow.wallet.UtxoEntry; import javafx.geometry.Pos; @@ -12,6 +11,8 @@ import javafx.util.Duration; import java.text.DateFormat; import java.text.SimpleDateFormat; +import static com.sparrowwallet.sparrow.control.EntryCell.HashIndexEntryContextMenu; + public class DateCell extends TreeTableCell { private static final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm"); @@ -36,11 +37,11 @@ public class DateCell extends TreeTableCell { UtxoEntry utxoEntry = (UtxoEntry)entry; if(utxoEntry.getHashIndex().getHeight() <= 0) { setText("Unconfirmed " + (utxoEntry.getHashIndex().getHeight() < 0 ? "Parent " : "") + (utxoEntry.getWallet().isWhirlpoolMixWallet() ? "(Not yet mixable)" : (utxoEntry.isSpendable() ? "(Spendable)" : "(Not yet spendable)"))); - setContextMenu(null); + setContextMenu(new HashIndexEntryContextMenu(getTreeTableView(), utxoEntry)); } else if(utxoEntry.getHashIndex().getDate() != null) { String date = DATE_FORMAT.format(utxoEntry.getHashIndex().getDate()); setText(date); - setContextMenu(new DateContextMenu(date, utxoEntry.getHashIndex())); + setContextMenu(new DateContextMenu(getTreeTableView(), utxoEntry, date)); } else { setText("Unknown"); setContextMenu(null); @@ -56,8 +57,10 @@ public class DateCell extends TreeTableCell { } } - private static class DateContextMenu extends ContextMenu { - public DateContextMenu(String date, BlockTransactionHashIndex reference) { + private static class DateContextMenu extends HashIndexEntryContextMenu { + public DateContextMenu(TreeTableView treeTableView, UtxoEntry utxoEntry, String date) { + super(treeTableView, utxoEntry); + MenuItem copyDate = new MenuItem("Copy Date"); copyDate.setOnAction(AE -> { hide(); @@ -70,7 +73,7 @@ public class DateCell extends TreeTableCell { copyHeight.setOnAction(AE -> { hide(); ClipboardContent content = new ClipboardContent(); - content.putString(reference.getHeight() > 0 ? Integer.toString(reference.getHeight()) : "Mempool"); + content.putString(utxoEntry.getHashIndex().getHeight() > 0 ? Integer.toString(utxoEntry.getHashIndex().getHeight()) : "Mempool"); Clipboard.getSystemClipboard().setContent(content); }); diff --git a/src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java b/src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java index 9aea389c..b53916eb 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java @@ -691,7 +691,7 @@ public class EntryCell extends TreeTableCell implements Confirmati } } - private static class HashIndexEntryContextMenu extends ContextMenu { + static class HashIndexEntryContextMenu extends ContextMenu { public HashIndexEntryContextMenu(TreeTableView treeTableView, HashIndexEntry hashIndexEntry) { MenuItem viewTransaction = new MenuItem("View Transaction"); viewTransaction.setGraphic(getViewTransactionGlyph()); diff --git a/src/main/resources/com/sparrowwallet/sparrow/darktheme.css b/src/main/resources/com/sparrowwallet/sparrow/darktheme.css index 0d3b0c77..a1dee1b8 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/darktheme.css +++ b/src/main/resources/com/sparrowwallet/sparrow/darktheme.css @@ -331,3 +331,7 @@ HorizontalHeaderColumn > TableColumnHeader.column-header.table-column{ .root .hyperlink:visited { -fx-text-fill: #229df5; } + +#grid .spreadsheet-cell.selection { + -fx-text-fill: -fx-base; +} \ No newline at end of file