mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-08-17 06:41:03 +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:
parent
3b6480f3f2
commit
c7743b28c6
24 changed files with 833 additions and 48 deletions
|
@ -15,15 +15,27 @@ use tokio::sync::mpsc;
|
|||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct VolumeModule {
|
||||
/// The format string to use for the widget button label.
|
||||
/// For available tokens, see [below](#formatting-tokens).
|
||||
///
|
||||
/// **Default**: `{icon} {percentage}%`
|
||||
#[serde(default = "default_format")]
|
||||
format: String,
|
||||
|
||||
/// Maximum value to allow volume sliders to reach.
|
||||
/// Pulse supports values > 100 but this may result in distortion.
|
||||
///
|
||||
/// **Default**: `100`
|
||||
#[serde(default = "default_max_volume")]
|
||||
max_volume: f64,
|
||||
|
||||
/// Volume state icons.
|
||||
///
|
||||
/// See [icons](#icons).
|
||||
#[serde(default)]
|
||||
icons: Icons,
|
||||
|
||||
/// See [common options](module-level-options#common-options).
|
||||
#[serde(flatten)]
|
||||
pub common: Option<CommonConfig>,
|
||||
}
|
||||
|
@ -34,12 +46,27 @@ fn default_format() -> String {
|
|||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
pub struct Icons {
|
||||
/// Icon to show for high volume levels.
|
||||
///
|
||||
/// **Default**: ``
|
||||
#[serde(default = "default_icon_volume_high")]
|
||||
volume_high: String,
|
||||
|
||||
/// Icon to show for medium volume levels.
|
||||
///
|
||||
/// **Default**: ``
|
||||
#[serde(default = "default_icon_volume_medium")]
|
||||
volume_medium: String,
|
||||
|
||||
/// Icon to show for low volume levels.
|
||||
///
|
||||
/// **Default**: ``
|
||||
#[serde(default = "default_icon_volume_low")]
|
||||
volume_low: String,
|
||||
|
||||
/// Icon to show for muted outputs.
|
||||
///
|
||||
/// **Default**: ``
|
||||
#[serde(default = "default_icon_muted")]
|
||||
muted: String,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue