This commit is contained in:
Nathan Sobo 2023-04-12 10:07:17 -06:00
parent 83070a19c4
commit 868301bedb
26 changed files with 194 additions and 175 deletions

View file

@ -50,7 +50,7 @@ impl View for ActiveBufferLanguage {
"ActiveBufferLanguage"
}
fn render(&mut self, cx: &mut ViewContext<Self>) -> ElementBox {
fn render(&mut self, cx: &mut ViewContext<Self>) -> ElementBox<Self> {
if let Some(active_language) = self.active_language.as_ref() {
let active_language_text = if let Some(active_language_text) = active_language {
active_language_text.to_string()
@ -58,7 +58,7 @@ impl View for ActiveBufferLanguage {
"Unknown".to_string()
};
MouseEventHandler::<Self>::new(0, cx, |state, cx| {
MouseEventHandler::<Self, Self>::new(0, cx, |state, cx| {
let theme = &cx.global::<Settings>().theme.workspace.status_bar;
let style = theme.active_language.style_for(state, false);
Label::new(active_language_text, style.text.clone())
@ -67,7 +67,9 @@ impl View for ActiveBufferLanguage {
.boxed()
})
.with_cursor_style(CursorStyle::PointingHand)
.on_click(MouseButton::Left, |_, cx| cx.dispatch_action(crate::Toggle))
.on_click(MouseButton::Left, |_, _, cx| {
cx.dispatch_action(crate::Toggle)
})
.boxed()
} else {
Empty::new().boxed()

View file

@ -120,7 +120,7 @@ impl View for LanguageSelector {
"LanguageSelector"
}
fn render(&mut self, cx: &mut ViewContext<Self>) -> ElementBox {
fn render(&mut self, cx: &mut ViewContext<Self>) -> ElementBox<Self> {
ChildView::new(&self.picker, cx).boxed()
}
@ -210,7 +210,7 @@ impl PickerDelegate for LanguageSelector {
mouse_state: &mut MouseState,
selected: bool,
cx: &AppContext,
) -> ElementBox {
) -> ElementBox<Picker<Self>> {
let settings = cx.global::<Settings>();
let theme = &settings.theme;
let mat = &self.matches[ix];