mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-11-04 21:36:45 +00:00
show network in main tab header background when not using mainnet
This commit is contained in:
parent
ebb7d23a05
commit
b27709e96f
1 changed files with 17 additions and 0 deletions
|
@ -392,6 +392,7 @@ public class AppController implements Initializable {
|
||||||
});
|
});
|
||||||
|
|
||||||
openTransactionIdItem.disableProperty().bind(onlineProperty().not());
|
openTransactionIdItem.disableProperty().bind(onlineProperty().not());
|
||||||
|
setNetworkLabel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setPlatformApplicationMenu() {
|
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) {
|
public void showIntroduction(ActionEvent event) {
|
||||||
WelcomeDialog welcomeDialog = new WelcomeDialog();
|
WelcomeDialog welcomeDialog = new WelcomeDialog();
|
||||||
Optional<Mode> optionalMode = welcomeDialog.showAndWait();
|
Optional<Mode> optionalMode = welcomeDialog.showAndWait();
|
||||||
|
|
Loading…
Reference in a new issue