Expand description
Ratatui adapter for hjkl-menu.
Paints a ContextMenu into a ratatui Frame using MenuTheme for
styling. The popup is a floating bordered box clamped to screen_size.
§Usage
// (requires a real ratatui terminal — compile-checked, not run in CI)
use hjkl_menu::{build_code_menu, ContextMenu};
use hjkl_menu_tui::{MenuTheme, bounding_rect, render};
// Build menu:
// let items = build_code_menu(true, true);
// let menu = ContextMenu::new(items, (col, row));
// Compute rect and render:
// let screen = frame.area();
// let rect = bounding_rect(&menu, screen);
// render(frame, &menu, screen, &MenuTheme::default());Structs§
- Menu
Theme - Color palette for the context menu.
Functions§
- bounding_
rect - Convert
hjkl_menu::ContextMenugeometry to a ratatuiRectclamped toscreen_size. - render
- Render
menuas a floating bordered popup insidescreen_size.