9#ifndef ASW_MODULES_UI_CHECKBOX_H
10#define ASW_MODULES_UI_CHECKBOX_H
A button that toggles between checked and unchecked.
void draw(Context &ctx) override
Draw the checkbox.
std::function< void(bool)> on_change
Callback invoked when checked changes by user input.
asw::Texture texture_checked_hover
Texture shown when checked and hovered or focused. Falls back to texture_checked.
bool checked
Whether the box is checked.
const CheckboxStyle & get_checkbox_style(const Context &ctx) const
Get the style this checkbox draws with.
asw::Texture texture_checked
Texture shown when checked. Falls back to texture.
void activate(Context &ctx) override
Toggle checked, then call on_change and on_click.
std::optional< CheckboxStyle > checkbox_style
Style for this checkbox only. Uses the theme checkbox style when empty. The inherited Button::style i...
Shared state for the UI system.
Theme theme
The current UI theme.
std::shared_ptr< SDL_Texture > Texture
Alias for a shared pointer to an SDL_Texture.
How a checkbox looks. Set on Theme::checkbox for every checkbox, or on Checkbox::checkbox_style for o...
CheckboxStyle checkbox
Default checkbox style.