Skip to main content

Crate tuiserial_ui

Crate tuiserial_ui 

Source
Expand description

Terminal user interface components for tuiserial

This crate provides the UI rendering logic using ratatui for displaying serial port configuration, logs, and user interactions with full mouse support.

§Architecture

The UI is organized into modular components:

  • areas: UI area definitions and mouse interaction handling
  • menu: Menu bar and dropdown rendering
  • config: Configuration panel with dropdowns for serial settings
  • status: Status panel and statistics display
  • log: Log area showing serial communication data
  • tx: Transmission input area
  • notification: Notification bar for user messages
  • utils: Utility functions for UI rendering

Re-exports§

pub use crossterm;
pub use ratatui;

Structs§

UiAreas
UI area rectangles for mouse interaction

Enums§

CursorType
Mouse cursor type for different areas
MouseAction
Mouse action result
ScrollAction
Scroll action
ScrollDirection
Scroll direction

Functions§

calculate_dropdown_area
Get the area for a dropdown menu
draw
Main draw function - renders the entire application UI
draw_context_shortcuts
Draw an inline shortcuts reference (for specific contexts)
draw_shortcuts_help
Draw the keyboard shortcuts help overlay
draw_shortcuts_hint
Draw a compact shortcuts hint bar
find_clicked_menu
Find which menu was clicked based on mouse position
get_clicked_field
Determine which field was clicked based on coordinates
get_clicked_menu
Get which menu was clicked in the menu bar
get_clicked_tab
Check if tab bar was clicked and return tab index
get_cursor_type
Get appropriate cursor type for position
get_hover_style
Get visual feedback for hover state
get_ui_areas
Get the UI areas for mouse interaction
handle_mouse_click
Handle mouse click events
handle_mouse_hover
Handle mouse hover/move events
handle_mouse_scroll
Handle mouse scroll events in log area
is_clickable_area
Check if mouse is in a clickable area
is_inside
Check if a point is inside a rectangle
is_shortcuts_hint_clicked
Check if shortcuts hint area was clicked
update_cursor_state
Update terminal cursor position and visibility (called during rendering)