diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/ReceiveController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/ReceiveController.java index 9ec8e452..88d890bf 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/ReceiveController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/ReceiveController.java @@ -70,6 +70,8 @@ public class ReceiveController extends WalletFormController implements Initializ private NodeEntry currentEntry; + private QRDisplayDialog addressQrDialog; + @Override public void initialize(URL location, ResourceBundle resources) { EventManager.get().register(this); @@ -83,10 +85,11 @@ public class ReceiveController extends WalletFormController implements Initializ displayAddress.setVisible(false); qrCode.setOnMouseClicked(event -> { - if(currentEntry != null) { - QRDisplayDialog qrDisplayDialog = new QRDisplayDialog(currentEntry.getAddress().toString()); - qrDisplayDialog.initOwner(address.getScene().getWindow()); - qrDisplayDialog.showAndWait(); + if(currentEntry != null && addressQrDialog == null) { + addressQrDialog = new QRDisplayDialog(currentEntry.getAddress().toString()); + addressQrDialog.initOwner(address.getScene().getWindow()); + addressQrDialog.showAndWait(); + addressQrDialog = null; } }); @@ -198,6 +201,9 @@ public class ReceiveController extends WalletFormController implements Initializ public void refreshAddress() { NodeEntry freshEntry = getWalletForm().getFreshNodeEntry(KeyPurpose.RECEIVE, currentEntry); setNodeEntry(freshEntry); + if(addressQrDialog != null) { + addressQrDialog.close(); + } } private void ensureSufficientGapLimit(int index) { diff --git a/src/main/resources/com/sparrowwallet/sparrow/wallet/receive.css b/src/main/resources/com/sparrowwallet/sparrow/wallet/receive.css index ad8735ba..a9edfa92 100644 --- a/src/main/resources/com/sparrowwallet/sparrow/wallet/receive.css +++ b/src/main/resources/com/sparrowwallet/sparrow/wallet/receive.css @@ -9,6 +9,11 @@ .qr-code { -fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.8), 10, 0, 0, 0); -fx-padding: 20; + -fx-cursor: hand; +} + +.qr-code:hover { + -fx-effect: dropshadow(three-pass-box, rgba(0,0,0,0.5), 10, 0, 0, 0); } #lastUsedField .input-container, #derivationField .input-container {