Fix style of menu folders

This commit is contained in:
Jeremy Soller 2024-09-27 09:34:37 -06:00
parent cf6a35474e
commit 973018fdb7
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
2 changed files with 25 additions and 5 deletions

View file

@ -299,7 +299,17 @@ where
.size(16)
.icon()
.into(),
]),
])
.style(
// Menu folders have no on_press so they take on the disabled style by default
if children.is_empty() {
// This will make the folder use the disabled style if it has no children
theme::Button::MenuItem
} else {
// This will make the folder use the enabled style if it has children
theme::Button::MenuFolder
},
),
menu_items(key_binds, children),
));
}