Add index to EntryState (#933)

Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This commit is contained in:
Herring
2024-09-30 23:18:59 +02:00
committed by GitHub
parent dfb9558eaf
commit 1d40687a40
9 changed files with 74 additions and 22 deletions

View File

@@ -123,10 +123,7 @@ class MenuBase : public ComponentBase, public MenuOption {
const bool is_selected = (selected() == i);
const EntryState state = {
entries[i],
false,
is_selected,
is_focused,
entries[i], false, is_selected, is_focused, i,
};
auto focus_management = (selected_focus_ != i) ? nothing
@@ -625,11 +622,8 @@ Component MenuEntry(MenuEntryOption option) {
const bool focused = Focused();
UpdateAnimationTarget();
const EntryState state = {
label(),
false,
hovered_,
focused,
const EntryState state{
label(), false, hovered_, focused, Index(),
};
const Element element =