From d559b437b3345f64526a783f0efa929fcc511730 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 12 May 2021 09:02:39 +0200 Subject: [PATCH] bring window to front one external file load --- .../java/com/sparrowwallet/sparrow/AppController.java | 8 -------- src/main/java/com/sparrowwallet/sparrow/AppServices.java | 5 +++++ .../sparrow/wallet/TransactionsController.java | 5 ++++- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index 351f639b..3a45ba0c 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -1803,10 +1803,6 @@ public class AppController implements Initializable { @Subscribe public void requestWalletOpen(RequestWalletOpenEvent event) { if(tabs.getScene().getWindow().equals(event.getWindow())) { - if(event.getWindow() instanceof Stage) { - ((Stage)event.getWindow()).toFront(); - } - if(event.getFile() != null) { openWalletFile(event.getFile(), true); } else { @@ -1818,10 +1814,6 @@ public class AppController implements Initializable { @Subscribe public void requestTransactionOpen(RequestTransactionOpenEvent event) { if(tabs.getScene().getWindow().equals(event.getWindow())) { - if(event.getWindow() instanceof Stage) { - ((Stage)event.getWindow()).toFront(); - } - if(event.getFile() != null) { openTransactionFile(event.getFile()); } else { diff --git a/src/main/java/com/sparrowwallet/sparrow/AppServices.java b/src/main/java/com/sparrowwallet/sparrow/AppServices.java index 00072953..8c5d3fe0 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppServices.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppServices.java @@ -653,6 +653,11 @@ public class AppServices { openWindow = getActiveWindow(); } + if(openWindow instanceof Stage) { + ((Stage)openWindow).setAlwaysOnTop(true); + ((Stage)openWindow).setAlwaysOnTop(false); + } + for(File file : openFiles) { if(isWalletFile(file)) { EventManager.get().post(new RequestWalletOpenEvent(openWindow, file)); diff --git a/src/main/java/com/sparrowwallet/sparrow/wallet/TransactionsController.java b/src/main/java/com/sparrowwallet/sparrow/wallet/TransactionsController.java index f80ac439..9bd999c8 100644 --- a/src/main/java/com/sparrowwallet/sparrow/wallet/TransactionsController.java +++ b/src/main/java/com/sparrowwallet/sparrow/wallet/TransactionsController.java @@ -160,7 +160,10 @@ public class TransactionsController extends WalletFormController implements Init logMessage = logMessage.replace("m/", "/"); String date = LOG_DATE_FORMAT.format(new Date()); String logLine = "\n" + date + " " + logMessage; - Platform.runLater(() -> loadingLog.appendText(logLine)); + Platform.runLater(() -> { + loadingLog.appendText(logLine); + loadingLog.setScrollLeft(0); + }); } }