OverlayManager
OverlayManager
Section titled “OverlayManager”#include <OverlayManager.hpp>Manages floating widgets that render above the main widget tree.
Overlays are used for dropdowns, tooltips, modals, and other popups that need to escape their parent’s bounds. They are rendered after the main tree so they always appear on top.
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
void | push | Pushes a widget as an overlay at the given screen rect. |
void | pop | Removes the topmost overlay. |
void | clear | Removes all overlays. |
void | resize | Relayouts all overlays for new terminal size. |
bool | hasOverlays const inline | Returns true if there are any active overlays. |
const std::vector< std::pair< std::shared_ptr< Widget >, Rect > > & | stack const inline | Returns the overlay stack (bottom to top). |
std::vector< std::pair< std::shared_ptr< Widget >, Rect > > & | stack inline |
void push(std::shared_ptr< Widget > widget, Rect rect)Pushes a widget as an overlay at the given screen rect.
Parameters
Section titled “Parameters”-
widgetThe widget to display as an overlay -
rectThe screen position and size to render it at
void pop()Removes the topmost overlay.
void clear()Removes all overlays.
resize
Section titled “resize”void resize(int termWidth, int termHeight)Relayouts all overlays for new terminal size.
hasOverlays
Section titled “hasOverlays”const inline
inline bool hasOverlays() constReturns true if there are any active overlays.
const inline
inline const std::vector< std::pair< std::shared_ptr< Widget >, Rect > > & stack() constReturns the overlay stack (bottom to top).
inline
inline std::vector< std::pair< std::shared_ptr< Widget >, Rect > > & stack()Private Attributes
Section titled “Private Attributes”| Return | Name | Description |
|---|---|---|
std::vector< std::pair< std::shared_ptr< Widget >, Rect > > | overlays |
overlays
Section titled “overlays”std::vector< std::pair< std::shared_ptr< Widget >, Rect > > overlays