Fixed: Popup now disappear if the window is not focused
This commit is contained in:
@@ -79,6 +79,7 @@ public class MainFXMLController {
|
|||||||
@FXML
|
@FXML
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
Font.loadFont(getClass().getResourceAsStream("/Fonts/InknutAntiqua-Regular.ttf"), 14);
|
Font.loadFont(getClass().getResourceAsStream("/Fonts/InknutAntiqua-Regular.ttf"), 14);
|
||||||
|
popup = new Popup();
|
||||||
mainHBox.sceneProperty().addListener((obs, oldScene, newScene) -> {
|
mainHBox.sceneProperty().addListener((obs, oldScene, newScene) -> {
|
||||||
if (newScene != null) {
|
if (newScene != null) {
|
||||||
newScene.getRoot().applyCss();
|
newScene.getRoot().applyCss();
|
||||||
@@ -589,7 +590,6 @@ public class MainFXMLController {
|
|||||||
"-fx-background-radius: 10;"
|
"-fx-background-radius: 10;"
|
||||||
);
|
);
|
||||||
|
|
||||||
popup = new Popup();
|
|
||||||
popup.getContent().add(popupCards);
|
popup.getContent().add(popupCards);
|
||||||
popup.setAutoHide(false); // gestito manualmente per permettere click sulle carte
|
popup.setAutoHide(false); // gestito manualmente per permettere click sulle carte
|
||||||
popup.addEventHandler(Event.ANY, e -> {
|
popup.addEventHandler(Event.ANY, e -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user