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

@ -0,0 +1,34 @@
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, PartialEq, Default)]
pub(crate) struct TaskSettings {
pub(crate) show_status_indicator: bool,
}
/// Task-related settings.
#[derive(Serialize, Deserialize, PartialEq, Default, Clone, JsonSchema)]
pub(crate) struct TaskSettingsContent {
/// Whether to show task status indicator in the status bar. Default: true
show_status_indicator: Option<bool>,
}
impl settings::Settings for TaskSettings {
const KEY: Option<&'static str> = Some("task");
type FileContent = TaskSettingsContent;
fn load(
default_value: &Self::FileContent,
user_values: &[&Self::FileContent],
_: &mut gpui::AppContext,
) -> gpui::Result<Self>
where
Self: Sized,
{
let this = Self::json_merge(default_value, user_values)?;
Ok(Self {
show_status_indicator: this.show_status_indicator.unwrap_or(true),
})
}
}