From b27709e96ff85614a3023294feeb66b96c566189 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 26 Oct 2022 15:54:59 +0200 Subject: [PATCH] show network in main tab header background when not using mainnet --- .../sparrowwallet/sparrow/AppController.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/AppController.java b/src/main/java/com/sparrowwallet/sparrow/AppController.java index 09b664a3..ae56d7d7 100644 --- a/src/main/java/com/sparrowwallet/sparrow/AppController.java +++ b/src/main/java/com/sparrowwallet/sparrow/AppController.java @@ -392,6 +392,7 @@ public class AppController implements Initializable { }); openTransactionIdItem.disableProperty().bind(onlineProperty().not()); + setNetworkLabel(); } private void setPlatformApplicationMenu() { @@ -419,6 +420,22 @@ public class AppController implements Initializable { } } + private void setNetworkLabel() { + if(Network.get() != Network.MAINNET) { + Platform.runLater(() -> { + StackPane tabBackground = (StackPane)tabs.lookup(".tab-header-background"); + if(tabBackground != null) { + HBox hBox = new HBox(); + Label label = new Label(Network.get().toDisplayString()); + label.setPadding(new Insets(0, 10, 0, 0)); + hBox.getChildren().add(label); + hBox.setAlignment(Pos.CENTER_RIGHT); + tabBackground.getChildren().add(hBox); + } + }); + } + } + public void showIntroduction(ActionEvent event) { WelcomeDialog welcomeDialog = new WelcomeDialog(); Optional optionalMode = welcomeDialog.showAndWait();