mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-24 12:46:45 +00:00
make welcome dialog server toggle uneditable and add tooltip to indicate demonstration only
This commit is contained in:
parent
f1d7fc656c
commit
11a3bfd893
1 changed files with 7 additions and 0 deletions
|
@ -7,7 +7,10 @@ import javafx.beans.value.ChangeListener;
|
||||||
import javafx.beans.value.ObservableValue;
|
import javafx.beans.value.ObservableValue;
|
||||||
import javafx.event.ActionEvent;
|
import javafx.event.ActionEvent;
|
||||||
import javafx.event.Event;
|
import javafx.event.Event;
|
||||||
|
import javafx.event.EventHandler;
|
||||||
|
import javafx.event.EventType;
|
||||||
import javafx.fxml.FXML;
|
import javafx.fxml.FXML;
|
||||||
|
import javafx.scene.control.Tooltip;
|
||||||
import javafx.scene.input.MouseButton;
|
import javafx.scene.input.MouseButton;
|
||||||
import javafx.scene.input.MouseEvent;
|
import javafx.scene.input.MouseEvent;
|
||||||
import javafx.scene.layout.VBox;
|
import javafx.scene.layout.VBox;
|
||||||
|
@ -48,6 +51,10 @@ public class WelcomeController {
|
||||||
|
|
||||||
welcomeBox.getStyleClass().add("offline");
|
welcomeBox.getStyleClass().add("offline");
|
||||||
serverStatus.setText("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) -> {
|
serverToggle.selectedProperty().addListener((observable, oldValue, newValue) -> {
|
||||||
serverStatus.setText(newValue ? "Connected (demonstration only)" : "Offline");
|
serverStatus.setText(newValue ? "Connected (demonstration only)" : "Offline");
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue