Merge remote-tracking branch 'origin/callback-handles' into search2

This commit is contained in:
Piotr Osiewicz 2023-11-21 00:40:20 +01:00
commit 54a3b56935
118 changed files with 2175 additions and 6954 deletions

View file

@ -7,8 +7,8 @@ pub struct ToolbarControls {
editor: Option<WeakView<ProjectDiagnosticsEditor>>,
}
impl Render<Self> for ToolbarControls {
type Element = Div<Self>;
impl Render for ToolbarControls {
type Element = Div;
fn render(&mut self, cx: &mut ViewContext<Self>) -> Self::Element {
let include_warnings = self
@ -26,14 +26,14 @@ impl Render<Self> for ToolbarControls {
div().child(
IconButton::new("toggle-warnings", Icon::ExclamationTriangle)
.tooltip(move |_, cx| Tooltip::text(tooltip, cx))
.on_click(|this: &mut Self, cx| {
.tooltip(move |cx| Tooltip::text(tooltip, cx))
.on_click(cx.listener(|this, _, cx| {
if let Some(editor) = this.editor.as_ref().and_then(|editor| editor.upgrade()) {
editor.update(cx, |editor, cx| {
editor.toggle_warnings(&Default::default(), cx);
});
}
}),
})),
)
}
}