Skip to main content

Module ui

Module ui 

Source
Expand description

User Interface (UI) module for the matrix_gui framework.

This module provides the core UI infrastructure including:

  • Error handling for GUI operations
  • Widget rendering and state management
  • Interaction handling (touch/mouse input)
  • Focus management for keyboard navigation
  • Drawing primitives and utilities
  • Alignment and layout helpers

§Core Components

  • Ui: Main UI context that manages drawing, state, and interactions
  • Widget: Trait for drawable UI components
  • Response: Result type for widget operations
  • [Interaction]: Input event types (pressed, drag, release)

§Example

use matrix_gui::prelude::*;
use embedded_graphics::primitives::Rectangle;

// Create UI context
let mut ui = Ui::new_fullscreen(&mut display, &widget_states, &style);

// Add widgets
ui.add(my_widget);

// Handle interactions
ui.interact(Interaction::Pressed(point));

Structs§

Align
Combined horizontal and vertical alignment.
Ui
Main UI context for managing widgets, drawing, and interactions.

Enums§

GuiError
Error types that can occur during GUI operations.
HorizontalAlign
Horizontal alignment options for UI elements.
Response
Response from a widget operation.
VerticalAlign
Vertical alignment options for UI elements.

Traits§

Widget
Trait for drawable UI widgets.

Type Aliases§

GuiResult
Result type alias for GUI operations.