Add MenuEntry. (#199)

This will address comments from:
https://github.com/ArthurSonzogni/FTXUI/issues/194
This commit is contained in:
Arthur Sonzogni
2021-09-04 18:43:56 +02:00
committed by GitHub
parent 2ccc599db9
commit b99106a7c9
5 changed files with 147 additions and 0 deletions

View File

@@ -37,6 +37,7 @@ Component Input(StringRef content,
Component Menu(ConstStringListRef entries,
int* selected_,
Ref<MenuOption> = {});
Component MenuEntry(ConstStringRef label, Ref<MenuEntryOption> = {});
Component Radiobox(ConstStringListRef entries,
int* selected_,
Ref<RadioboxOption> option = {});

View File

@@ -23,6 +23,16 @@ struct MenuOption {
Ref<int> focused_entry = 0;
};
/// @brief Option for the MenuEntry component.
/// @ingroup component
struct MenuEntryOption {
Decorator style_normal = nothing; ///< style.
Decorator style_focused = inverted; ///< Style when focused.
Decorator style_selected = bold; ///< Style when selected.
Decorator style_selected_focused =
Decorator(inverted) | bold; ///< Style when selected and focused.
};
/// @brief Option for the Button component.
/// @ingroup component
struct ButtonOption {