pub fn draw_checkbox(
row_rect: Rect,
checked: bool,
label: Option<&str>,
disabled: bool,
style: CheckboxStyle,
text_system: &mut TextSystem,
) -> Vec<DrawCmd>Expand description
Produces draw commands for a checkbox row without retaining interaction state.
The square is vertically centered at row_rect.x. A checked and enabled row
includes a checkmark; a checked but disabled row deliberately omits it.
Disabled state multiplies the box fill and border alpha by 0.45. None
draws no label, whereas Some("") still emits an empty text command.
Geometry values are not clamped, and content may extend outside row_rect.
ยงExamples
use ailloli_ui_core::Rect;
use ailloli_ui_text::TextSystem;
use ailloli_ui_widgets::controls::{draw_checkbox, CheckboxStyle};
let mut text = TextSystem::new();
let commands = draw_checkbox(
Rect::new(0.0, 0.0, 120.0, 24.0),
true,
Some("Ready"),
false,
CheckboxStyle::default(),
&mut text,
);
assert_eq!(commands.len(), 4); // fill, border, checkmark, and label