ui2: Clean up take
s
This commit is contained in:
parent
7b4a895ab9
commit
eb19071d84
4 changed files with 10 additions and 10 deletions
|
@ -250,7 +250,7 @@ impl<S: 'static> ListItem<S> {
|
||||||
pub struct ListEntry {
|
pub struct ListEntry {
|
||||||
disclosure_control_style: DisclosureControlVisibility,
|
disclosure_control_style: DisclosureControlVisibility,
|
||||||
indent_level: u32,
|
indent_level: u32,
|
||||||
label: Option<Label>,
|
label: Label,
|
||||||
left_content: Option<LeftContent>,
|
left_content: Option<LeftContent>,
|
||||||
variant: ListItemVariant,
|
variant: ListItemVariant,
|
||||||
size: ListEntrySize,
|
size: ListEntrySize,
|
||||||
|
@ -264,7 +264,7 @@ impl ListEntry {
|
||||||
Self {
|
Self {
|
||||||
disclosure_control_style: DisclosureControlVisibility::default(),
|
disclosure_control_style: DisclosureControlVisibility::default(),
|
||||||
indent_level: 0,
|
indent_level: 0,
|
||||||
label: Some(label),
|
label,
|
||||||
variant: ListItemVariant::default(),
|
variant: ListItemVariant::default(),
|
||||||
left_content: None,
|
left_content: None,
|
||||||
size: ListEntrySize::default(),
|
size: ListEntrySize::default(),
|
||||||
|
@ -412,7 +412,7 @@ impl ListEntry {
|
||||||
.relative()
|
.relative()
|
||||||
.children(self.disclosure_control(cx))
|
.children(self.disclosure_control(cx))
|
||||||
.children(left_content)
|
.children(left_content)
|
||||||
.children(self.label.take()),
|
.child(self.label),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ impl<S: 'static> Modal<S> {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render(mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Component<S> {
|
fn render(self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Component<S> {
|
||||||
let theme = theme(cx);
|
let theme = theme(cx);
|
||||||
|
|
||||||
v_stack()
|
v_stack()
|
||||||
|
@ -68,8 +68,8 @@ impl<S: 'static> Modal<S> {
|
||||||
.border_color(theme.border)
|
.border_color(theme.border)
|
||||||
.p_1()
|
.p_1()
|
||||||
.justify_end()
|
.justify_end()
|
||||||
.children(self.secondary_action.take())
|
.children(self.secondary_action)
|
||||||
.children(self.primary_action.take()),
|
.children(self.primary_action),
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
|
@ -131,7 +131,7 @@ impl PaletteItem {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render<S: 'static>(mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Component<S> {
|
fn render<S: 'static>(self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Component<S> {
|
||||||
div()
|
div()
|
||||||
.flex()
|
.flex()
|
||||||
.flex_row()
|
.flex_row()
|
||||||
|
@ -142,7 +142,7 @@ impl PaletteItem {
|
||||||
.child(Label::new(self.label.clone()))
|
.child(Label::new(self.label.clone()))
|
||||||
.children(self.sublabel.clone().map(|sublabel| Label::new(sublabel))),
|
.children(self.sublabel.clone().map(|sublabel| Label::new(sublabel))),
|
||||||
)
|
)
|
||||||
.children(self.keybinding.take())
|
.children(self.keybinding)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ impl<S: 'static> Details<S> {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render(mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Component<S> {
|
fn render(self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Component<S> {
|
||||||
let theme = theme(cx);
|
let theme = theme(cx);
|
||||||
|
|
||||||
v_stack()
|
v_stack()
|
||||||
|
@ -37,7 +37,7 @@ impl<S: 'static> Details<S> {
|
||||||
.size_full()
|
.size_full()
|
||||||
.child(self.text)
|
.child(self.text)
|
||||||
.children(self.meta.map(|m| m))
|
.children(self.meta.map(|m| m))
|
||||||
.children(self.actions.take().map(|a| a))
|
.children(self.actions.map(|a| a))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue