settings: Remove auxiliary Content types where possible (#16744)
Release Notes: - N/A
This commit is contained in:
parent
8f28445612
commit
ccf6f27b8f
49 changed files with 843 additions and 696 deletions
|
@ -2,22 +2,26 @@ use schemars::JsonSchema;
|
|||
use serde::{Deserialize, Serialize};
|
||||
use settings::{Settings, SettingsSources};
|
||||
|
||||
#[derive(Serialize, Deserialize, PartialEq, Default)]
|
||||
#[derive(Clone, Serialize, Deserialize, PartialEq, JsonSchema)]
|
||||
#[serde(default)]
|
||||
/// Task-related settings.
|
||||
pub(crate) struct TaskSettings {
|
||||
/// Whether to show task status indicator in the status bar. Default: true
|
||||
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 Default for TaskSettings {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
show_status_indicator: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Settings for TaskSettings {
|
||||
const KEY: Option<&'static str> = Some("task");
|
||||
|
||||
type FileContent = TaskSettingsContent;
|
||||
type FileContent = Self;
|
||||
|
||||
fn load(
|
||||
sources: SettingsSources<Self::FileContent>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue