Merge remote-tracking branch 'origin/Main-UI' into Main-UI

This commit is contained in:
2025-09-03 17:31:57 +03:30
17 changed files with 682 additions and 42 deletions
@@ -62,6 +62,9 @@ public class MainController {
@FXML private ImageView menuIcon;
private SidebarMenuController sidebarController; //save sidebar controller
// === Overlay ===
@FXML private StackPane overlayLayer;
// === Time formatter for messages ===
private static final java.time.format.DateTimeFormatter FMT_HHMM =
java.time.format.DateTimeFormatter.ofPattern("HH:mm");
@@ -84,6 +87,9 @@ public class MainController {
public static MainController getInstance() {
return instance;
}
// Keep track of the scene user comes from
private final Deque<Node> navigationStack = new ArrayDeque<>();
private final Map<UUID, ChatItemController> itemControllers = new HashMap<>();
@@ -590,13 +596,30 @@ public class MainController {
// === Overlay Handling ===
public void showOverlay(Node overlayNode) {
mainRoot.getChildren().add(overlayNode);
if (!overlayLayer.getChildren().isEmpty()) {
Node current = overlayLayer.getChildren().get(overlayLayer.getChildren().size() - 1);
navigationStack.push(current);
overlayLayer.getChildren().remove(current);
}
overlayLayer.getChildren().add(overlayNode);
}
public void closeOverlay(Node overlayNode) {
mainRoot.getChildren().remove(overlayNode);
overlayLayer.getChildren().remove(overlayNode);
}
public void goBack(Pane currentOverlay) {
// Remove the current overlay
closeOverlay(currentOverlay);
if (!navigationStack.isEmpty()) {
Node previous = navigationStack.pop();
// Clear existing overlays before showing previous
overlayLayer.getChildren().clear();
overlayLayer.getChildren().add(previous);
}
}
// ===== Search UI state =====
private final java.util.List<SearchResult> searchBacking = new java.util.ArrayList<>();