From c1f9bbde2dd1c3b2878d643dfb54940a7e26ca0d Mon Sep 17 00:00:00 2001 From: crissnb Date: Sun, 10 Mar 2024 13:20:48 +0100 Subject: [PATCH] better search window positioning --- src/main/java/org/gecko/view/views/EditorView.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/gecko/view/views/EditorView.java b/src/main/java/org/gecko/view/views/EditorView.java index 236850c9..4b604e17 100644 --- a/src/main/java/org/gecko/view/views/EditorView.java +++ b/src/main/java/org/gecko/view/views/EditorView.java @@ -10,6 +10,7 @@ import javafx.beans.property.StringProperty; import javafx.beans.value.ObservableValue; import javafx.collections.SetChangeListener; +import javafx.geometry.Pos; import javafx.scene.Node; import javafx.scene.control.ContextMenu; import javafx.scene.control.Label; @@ -106,11 +107,12 @@ public EditorView( activateSearchWindow(false); AnchorPane floatingUI = new AnchorPane(); - floatingUI.getChildren().addAll(zoomButtons, currentViewLabel, viewSwitchButton, searchWindow); + floatingUI.getChildren().addAll(zoomButtons, currentViewLabel, viewSwitchButton); floatingUI.setPickOnBounds(false); // Build stack pane - currentViewPane.getChildren().addAll(viewElementPane.draw(), floatingUI); + currentViewPane.getChildren().addAll(viewElementPane.draw(), floatingUI, searchWindow); + StackPane.setAlignment(searchWindow, Pos.TOP_CENTER); // View element creator listener viewModel.getContainedPositionableViewModelElementsProperty().addListener(this::onUpdateViewElements); @@ -194,8 +196,6 @@ public Node drawInspector() { * @param activate true if the search window should be activated, false otherwise */ public void activateSearchWindow(boolean activate) { - AnchorPane.setTopAnchor(searchWindow, currentViewPane.getHeight() / 2); - AnchorPane.setLeftAnchor(searchWindow, currentViewPane.getWidth() / 2); searchWindow.setVisible(activate); searchWindow.requestFocus(); }