mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-02 12:26:45 +00:00
close qr display dialog for current fresh address when it updates
This commit is contained in:
parent
6b4c301458
commit
33d9f260c4
2 changed files with 15 additions and 4 deletions
|
@ -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) {
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue