tasks: Add status indicator to the status bar (#10267)

Release Notes:

- Added task status indicator to the status bar.
This commit is contained in:
Piotr Osiewicz 2024-04-08 14:43:00 +02:00 committed by GitHub
parent ce5bc399df
commit 4ce5b22989
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 153 additions and 6 deletions

View file

@ -30,6 +30,11 @@ pub struct Spawn {
pub task_name: Option<String>,
}
impl Spawn {
pub(crate) fn modal() -> Self {
Self { task_name: None }
}
}
/// Rerun last task
#[derive(PartialEq, Clone, Deserialize, Default)]
pub struct Rerun {
@ -144,16 +149,11 @@ impl TasksModal {
}
impl Render for TasksModal {
fn render(&mut self, cx: &mut ViewContext<Self>) -> impl gpui::prelude::IntoElement {
fn render(&mut self, _: &mut ViewContext<Self>) -> impl gpui::prelude::IntoElement {
v_flex()
.key_context("TasksModal")
.w(rems(34.))
.child(self.picker.clone())
.on_mouse_down_out(cx.listener(|modal, _, cx| {
modal.picker.update(cx, |picker, cx| {
picker.cancel(&Default::default(), cx);
})
}))
}
}