Skip to main content

Module toggle

Module toggle 

Source
Expand description

Toggle (checkbox) control for boolean values

Renders as: Label: [x] or Label: [ ]

This module provides a complete toggle component with:

  • State management (ToggleState)
  • Rendering (render_toggle, render_toggle_aligned)
  • Input handling (ToggleState::handle_mouse, handle_key)
  • Layout/hit testing (ToggleLayout)

Structs§

ToggleColors
Colors for the toggle control
ToggleLayout
Layout information returned after rendering for hit testing
ToggleState
State for a toggle control

Enums§

ToggleEvent
Events that can be returned from toggle input handling

Functions§

render_toggle
Render a toggle control
render_toggle_aligned
Render a toggle control with optional label width alignment