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 handlingmenu: Menu bar and dropdown renderingconfig: Configuration panel with dropdowns for serial settingsstatus: Status panel and statistics displaylog: Log area showing serial communication datatx: Transmission input areanotification: Notification bar for user messagesutils: Utility functions for UI rendering
Re-exports§
Structs§
- UiAreas
- UI area rectangles for mouse interaction
Enums§
- Cursor
Type - Mouse cursor type for different areas
- Mouse
Action - Mouse action result
- Scroll
Action - Scroll action
- Scroll
Direction - 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)