tasks: Add status indicator to the status bar (#10267)
Release Notes: - Added task status indicator to the status bar.
This commit is contained in:
parent
ce5bc399df
commit
4ce5b22989
7 changed files with 153 additions and 6 deletions
34
crates/tasks_ui/src/settings.rs
Normal file
34
crates/tasks_ui/src/settings.rs
Normal 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),
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue