Feature: Dropdown options with callback

This commit is contained in:
James Parker
2024-03-14 11:29:34 +00:00
parent ce5ac6b12f
commit dda2896700
4 changed files with 43 additions and 12 deletions

View File

@@ -74,7 +74,7 @@ Component Radiobox(ConstStringListRef entries,
int* selected_,
RadioboxOption options = {});
Component Dropdown(ConstStringListRef entries, int* selected);
Component Dropdown(ConstStringListRef entries, int* selected, DropdownOption options = {});
Component Toggle(ConstStringListRef entries, int* selected);
// General slider constructor:

View File

@@ -148,6 +148,17 @@ struct CheckboxOption {
std::function<void()> on_change = [] {};
};
/// @brief Option for the Dropdown component.
/// @ingroup component
struct DropdownOption {
bool border = true;
// Observer:
/// Called when the user change the state.
std::function<void()> on_change = [] {};
};
/// @brief Used to define style for the Input component.
struct InputState {
Element element;