Skip to content

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.

ReturnNameDescription
voidpushPushes a widget as an overlay at the given screen rect.
voidpopRemoves the topmost overlay.
voidclearRemoves all overlays.
voidresizeRelayouts all overlays for new terminal size.
boolhasOverlays const inlineReturns true if there are any active overlays.
const std::vector< std::pair< std::shared_ptr< Widget >, Rect > > &stack const inlineReturns 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.

  • widget The widget to display as an overlay

  • rect The screen position and size to render it at


void pop()

Removes the topmost overlay.


void clear()

Removes all overlays.


void resize(int termWidth, int termHeight)

Relayouts all overlays for new terminal size.


const inline

inline bool hasOverlays() const

Returns true if there are any active overlays.


const inline

inline const std::vector< std::pair< std::shared_ptr< Widget >, Rect > > & stack() const

Returns the overlay stack (bottom to top).


inline

inline std::vector< std::pair< std::shared_ptr< Widget >, Rect > > & stack()
ReturnNameDescription
std::vector< std::pair< std::shared_ptr< Widget >, Rect > >overlays

std::vector< std::pair< std::shared_ptr< Widget >, Rect > > overlays