Simplify ContextMenu by not storing list components

This commit is contained in:
Marshall Bowers 2023-11-22 12:41:29 -05:00
parent 2c8d243d22
commit 031fca4105
5 changed files with 29 additions and 58 deletions

View file

@ -254,23 +254,6 @@ pub struct ListItem {
on_click: Option<Rc<dyn Fn(&ClickEvent, &mut WindowContext) + 'static>>,
}
impl Clone for ListItem {
fn clone(&self) -> Self {
Self {
id: self.id.clone(),
disabled: self.disabled,
indent_level: self.indent_level,
label: self.label.clone(),
left_slot: self.left_slot.clone(),
overflow: self.overflow,
size: self.size,
toggle: self.toggle,
variant: self.variant,
on_click: self.on_click.clone(),
}
}
}
impl ListItem {
pub fn new(id: impl Into<ElementId>, label: Label) -> Self {
Self {