mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-15 15:38:21 +08:00
Add MenuEntry. (#199)
This will address comments from: https://github.com/ArthurSonzogni/FTXUI/issues/194
This commit is contained in:
@@ -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 = {});
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user