failed.rs

 1use gpui::{FocusHandle, Focusable};
 2use ui::{
 3    h_flex, Color, Context, IntoElement, Label, LabelCommon, ParentElement, Render, Styled, Window,
 4};
 5
 6pub(crate) struct FailedState {
 7    focus_handle: FocusHandle,
 8}
 9impl FailedState {
10    pub(super) fn new(cx: &mut Context<Self>) -> Self {
11        Self {
12            focus_handle: cx.focus_handle(),
13        }
14    }
15}
16
17impl Focusable for FailedState {
18    fn focus_handle(&self, _: &ui::App) -> FocusHandle {
19        self.focus_handle.clone()
20    }
21}
22impl Render for FailedState {
23    fn render(&mut self, _: &mut Window, _: &mut Context<Self>) -> impl IntoElement {
24        h_flex()
25            .size_full()
26            .items_center()
27            .justify_center()
28            .child(Label::new("Failed to spawn debugging session").color(Color::Error))
29    }
30}