Added toggle switch widget.

This commit is contained in:
Dylan Smith
2026-01-16 16:28:00 -05:00
parent fd46ea65ca
commit 3ef5bd9240
7 changed files with 62 additions and 61 deletions

View File

@@ -49,4 +49,16 @@ void set_selected_menu_entry_idx(volatile pixel_t *const framebuffer, graphical_
void decrement_selected_menu_entry_idx(volatile pixel_t *const framebuffer, graphical_menu_t *const menu);
void increment_selected_menu_entry_idx(volatile pixel_t *const framebuffer, graphical_menu_t *const menu);
/*
* Add a toggle switch to the menu entry
* It is used to draw additional graphics on top of the menu entry
* Arguments:
* - menu_entry_size: the size of the menu entry
* - toggle_switch_value: (bool *) the value of the toggle switch
*
* Can be used as a callback function for the extra_draw_function field in the graphical_menu_entry_t struct
* This is why toggle_switch_value is a void pointer and not a bool pointer
*/
void add_toggle_switch_to_menu_entry(const menu_entry_size_t *const menu_entry_size, void *const toggle_switch_value);
#endif