Skip to content

Commit

Permalink
Merge pull request #180 from DecwLK/searchwindow_positinoing
Browse files Browse the repository at this point in the history
better search window positioning
  • Loading branch information
benjymin authored Mar 10, 2024
2 parents ec54408 + c1f9bbd commit e0a414e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/gecko/view/views/EditorView.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit e0a414e

Please sign in to comment.