Add option for Toggle.

This commit is contained in:
ArthurSonzogni
2021-07-10 11:03:01 +02:00
committed by Arthur Sonzogni
parent ae6473363d
commit fac373494d
7 changed files with 43 additions and 29 deletions

View File

@@ -46,6 +46,17 @@ struct RadioboxOption {
std::function<void()> on_change = []() {};
};
struct ToggleOption {
Decorator normal_style = dim;
Decorator focused_style = inverted;
Decorator selected_style = bold;
Decorator selected_focused_style = focused_style | selected_style;
// Callback.
std::function<void()> on_change = []() {};
std::function<void()> on_enter = []() {};
};
}; // namespace ftxui
#endif /* end of include guard: FTXUI_COMPONENT_COMPONENT_OPTIONS_HPP */