Improve mouse support for menu and toggle.

This commit is contained in:
ArthurSonzogni
2021-04-24 18:16:13 +02:00
parent 890a41a64c
commit 8037a5fa5f
14 changed files with 124 additions and 36 deletions

View File

@@ -19,10 +19,12 @@ class Menu : public Component {
// State.
std::vector<std::wstring> entries = {};
int selected = 0;
int focused = 0;
Decorator normal_style = nothing;
Decorator focused_style = inverted;
Decorator selected_style = bold;
Decorator normal_style = nothing;
Decorator selected_focused_style = focused_style | selected_style;
// State update callback.
std::function<void()> on_change = []() {};