diff --git a/src/widget/menu/menu_tree.rs b/src/widget/menu/menu_tree.rs index 7068fd29a44..809703744da 100644 --- a/src/widget/menu/menu_tree.rs +++ b/src/widget/menu/menu_tree.rs @@ -172,6 +172,8 @@ pub fn menu_button<'a, Message: 'a>( pub enum MenuItem>> { /// Represents a button menu item. Button(L, A), + /// Represents a button menu item that is disabled. + ButtonDisabled(L, A), /// Represents a checkbox menu item. CheckBox(L, bool, A), /// Represents a folder menu item. @@ -250,6 +252,16 @@ where trees.push(MenuTree::::new(menu_button)); } + MenuItem::ButtonDisabled(label, action) => { + let key = find_key(&action, key_binds); + let menu_button = menu_button(vec![ + widget::text(label).into(), + widget::horizontal_space(Length::Fill).into(), + widget::text(key).into(), + ]); + + trees.push(MenuTree::::new(menu_button)); + } MenuItem::CheckBox(label, value, action) => { let key = find_key(&action, key_binds); trees.push(MenuTree::new(