ZIm/crates/debugger_ui/src/session/failed.rs
Marshall Bowers b5dc09c0ca
Remove unneeded anonymous lifetimes from gpui::Context (#27686)
This PR removes a number of unneeded anonymous lifetimes from usages of
`gpui::Context`.

Release Notes:

- N/A
2025-03-28 19:26:30 +00:00

30 lines
813 B
Rust

use gpui::{FocusHandle, Focusable};
use ui::{
h_flex, Color, Context, IntoElement, Label, LabelCommon, ParentElement, Render, Styled, Window,
};
pub(crate) struct FailedState {
focus_handle: FocusHandle,
}
impl FailedState {
pub(super) fn new(cx: &mut Context<Self>) -> Self {
Self {
focus_handle: cx.focus_handle(),
}
}
}
impl Focusable for FailedState {
fn focus_handle(&self, _: &ui::App) -> FocusHandle {
self.focus_handle.clone()
}
}
impl Render for FailedState {
fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {
h_flex()
.size_full()
.items_center()
.justify_center()
.child(Label::new("Failed to spawn debugging session").color(Color::Error))
}
}