From 78a6ce4237aa7a49da1e23a43022e0af2badf73d Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 2 Mar 2022 17:30:21 +0200 Subject: [PATCH] decrease show delay on table tooltips --- .../java/com/sparrowwallet/sparrow/control/AddressCell.java | 2 ++ src/main/java/com/sparrowwallet/sparrow/control/CoinCell.java | 2 ++ src/main/java/com/sparrowwallet/sparrow/control/DateCell.java | 2 ++ .../java/com/sparrowwallet/sparrow/control/EntryCell.java | 4 ++++ 4 files changed, 10 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/control/AddressCell.java b/src/main/java/com/sparrowwallet/sparrow/control/AddressCell.java index 4d0f4559..33af4bf2 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/AddressCell.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/AddressCell.java @@ -9,6 +9,7 @@ import javafx.geometry.Pos; import javafx.scene.control.ContentDisplay; import javafx.scene.control.Tooltip; import javafx.scene.control.TreeTableCell; +import javafx.util.Duration; import org.controlsfx.glyphfont.Glyph; public class AddressCell extends TreeTableCell { @@ -35,6 +36,7 @@ public class AddressCell extends TreeTableCell { setText(address.toString()); setContextMenu(new EntryCell.AddressContextMenu(address, utxoEntry.getOutputDescriptor(), new NodeEntry(utxoEntry.getWallet(), utxoEntry.getNode()))); Tooltip tooltip = new Tooltip(); + tooltip.setShowDelay(Duration.millis(250)); tooltip.setText(getTooltipText(utxoEntry, addressStatus.isDuplicate())); setTooltip(tooltip); diff --git a/src/main/java/com/sparrowwallet/sparrow/control/CoinCell.java b/src/main/java/com/sparrowwallet/sparrow/control/CoinCell.java index 8574b10d..c3f82a4f 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/CoinCell.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/CoinCell.java @@ -10,6 +10,7 @@ import javafx.scene.control.ContentDisplay; import javafx.scene.control.Tooltip; import javafx.scene.control.TreeTableCell; import javafx.scene.layout.Region; +import javafx.util.Duration; import org.controlsfx.tools.Platform; import java.text.DecimalFormat; @@ -24,6 +25,7 @@ class CoinCell extends TreeTableCell { public CoinCell() { super(); tooltip = new Tooltip(); + tooltip.setShowDelay(Duration.millis(500)); getStyleClass().add("coin-cell"); if(Platform.getCurrent() == Platform.OSX) { getStyleClass().add("number-field"); diff --git a/src/main/java/com/sparrowwallet/sparrow/control/DateCell.java b/src/main/java/com/sparrowwallet/sparrow/control/DateCell.java index 2dcd5ef7..45806baa 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/DateCell.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/DateCell.java @@ -7,6 +7,7 @@ import javafx.geometry.Pos; import javafx.scene.control.*; import javafx.scene.input.Clipboard; import javafx.scene.input.ClipboardContent; +import javafx.util.Duration; import java.text.DateFormat; import java.text.SimpleDateFormat; @@ -46,6 +47,7 @@ public class DateCell extends TreeTableCell { } Tooltip tooltip = new Tooltip(); + tooltip.setShowDelay(Duration.millis(250)); int height = utxoEntry.getHashIndex().getHeight(); tooltip.setText(height > 0 ? Integer.toString(height) : "Mempool"); setTooltip(tooltip); diff --git a/src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java b/src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java index fd3a5dae..0d1e15e6 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/EntryCell.java @@ -20,6 +20,7 @@ import javafx.scene.control.*; import javafx.scene.input.Clipboard; import javafx.scene.input.ClipboardContent; import javafx.scene.layout.HBox; +import javafx.util.Duration; import org.controlsfx.glyphfont.FontAwesome; import org.controlsfx.glyphfont.Glyph; import org.slf4j.Logger; @@ -70,6 +71,7 @@ public class EntryCell extends TreeTableCell { } Tooltip tooltip = new Tooltip(); + tooltip.setShowDelay(Duration.millis(250)); tooltip.setText(getTooltip(transactionEntry)); setTooltip(tooltip); @@ -114,6 +116,7 @@ public class EntryCell extends TreeTableCell { setText(address.toString()); setContextMenu(new AddressContextMenu(address, nodeEntry.getOutputDescriptor(), nodeEntry)); Tooltip tooltip = new Tooltip(); + tooltip.setShowDelay(Duration.millis(250)); tooltip.setText(nodeEntry.getNode().toString()); setTooltip(tooltip); getStyleClass().add("address-cell"); @@ -150,6 +153,7 @@ public class EntryCell extends TreeTableCell { setText(hashIndexEntry.getDescription()); setContextMenu(new HashIndexEntryContextMenu(getTreeTableView(), hashIndexEntry)); Tooltip tooltip = new Tooltip(); + tooltip.setShowDelay(Duration.millis(250)); tooltip.setText(hashIndexEntry.getHashIndex().toString()); setTooltip(tooltip);