Rework List to use children (#3369)
This PR reworks the `List` component to use `children` instead of accepting a `Vec<ListItem>` in its constructor. This is a step towards making the `List` component more open. Release Notes: - N/A
This commit is contained in:
@@ -300,11 +300,14 @@ impl TerminalView {
|
||||
cx: &mut ViewContext<Self>,
|
||||
) {
|
||||
self.context_menu = Some(ContextMenu::build(cx, |menu, _| {
|
||||
menu.action(ListEntry::new(Label::new("Clear")), Box::new(Clear))
|
||||
.action(
|
||||
ListEntry::new(Label::new("Close")),
|
||||
Box::new(CloseActiveItem { save_intent: None }),
|
||||
)
|
||||
menu.action(
|
||||
ListEntry::new("clear", Label::new("Clear")),
|
||||
Box::new(Clear),
|
||||
)
|
||||
.action(
|
||||
ListEntry::new("close", Label::new("Close")),
|
||||
Box::new(CloseActiveItem { save_intent: None }),
|
||||
)
|
||||
}));
|
||||
dbg!(&position);
|
||||
// todo!()
|
||||
|
||||
Reference in New Issue
Block a user