From 11a3bfd8936de518de2462c75b500815bd2976ee Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Wed, 28 Apr 2021 12:33:18 +0200 Subject: [PATCH] make welcome dialog server toggle uneditable and add tooltip to indicate demonstration only --- .../java/com/sparrowwallet/sparrow/WelcomeController.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/WelcomeController.java b/src/main/java/com/sparrowwallet/sparrow/WelcomeController.java index 8ed70acb..1a00b2ad 100644 --- a/src/main/java/com/sparrowwallet/sparrow/WelcomeController.java +++ b/src/main/java/com/sparrowwallet/sparrow/WelcomeController.java @@ -7,7 +7,10 @@ import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; import javafx.event.ActionEvent; import javafx.event.Event; +import javafx.event.EventHandler; +import javafx.event.EventType; import javafx.fxml.FXML; +import javafx.scene.control.Tooltip; import javafx.scene.input.MouseButton; import javafx.scene.input.MouseEvent; import javafx.scene.layout.VBox; @@ -48,6 +51,10 @@ public class WelcomeController { welcomeBox.getStyleClass().add("offline"); serverStatus.setText("Offline"); + serverToggle.addEventFilter(MouseEvent.MOUSE_RELEASED, Event::consume); + Tooltip tooltip = new Tooltip("Demonstration only - you are not connected!"); + tooltip.setShowDelay(Duration.ZERO); + serverToggle.setTooltip(tooltip); serverToggle.selectedProperty().addListener((observable, oldValue, newValue) -> { serverStatus.setText(newValue ? "Connected (demonstration only)" : "Offline"); });