1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-08-18 07:11:04 +02:00

docs: add rustdoc comments to all module options

This part of an upcoming effort to generate documentation from code.

Pushing this out before that stage so that the JSON schema is fully documented.
This commit is contained in:
Jake Stanger 2024-05-19 15:16:01 +01:00
parent 3b6480f3f2
commit c7743b28c6
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
24 changed files with 833 additions and 48 deletions

View file

@ -11,28 +11,60 @@ use tracing::error;
#[derive(Debug, Deserialize, Clone)]
pub struct NotificationsModule {
/// Whether to show the current notification count.
///
/// **Default**: `true`
#[serde(default = "crate::config::default_true")]
show_count: bool,
/// SwayNC state icons.
///
/// See [icons](#icons).
#[serde(default)]
icons: Icons,
/// See [common options](module-level-options#common-options).
#[serde(flatten)]
pub common: Option<CommonConfig>,
}
#[derive(Debug, Deserialize, Clone)]
struct Icons {
/// Icon to show when the panel is closed, with no notifications.
///
/// **Default**: `󰍥`
#[serde(default = "default_icon_closed_none")]
closed_none: String,
/// Icon to show when the panel is closed, with notifications.
///
/// **Default**: `󱥂`
#[serde(default = "default_icon_closed_some")]
closed_some: String,
/// Icon to show when the panel is closed, with DnD enabled.
/// Takes higher priority than count-based icons.
///
/// **Default**: `󱅯`
#[serde(default = "default_icon_closed_dnd")]
closed_dnd: String,
/// Icon to show when the panel is open, with no notifications.
///
/// **Default**: `󰍡`
#[serde(default = "default_icon_open_none")]
open_none: String,
/// Icon to show when the panel is open, with notifications.
///
/// **Default**: `󱥁`
#[serde(default = "default_icon_open_some")]
open_some: String,
/// Icon to show when the panel is open, with DnD enabled.
/// Takes higher priority than count-based icons.
///
/// **Default**: `󱅮`
#[serde(default = "default_icon_open_dnd")]
open_dnd: String,
}