1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-08-17 14:51: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

@ -17,18 +17,67 @@ use super::{CustomWidget, CustomWidgetContext, ExecEvent};
#[derive(Debug, Deserialize, Clone)]
pub struct SliderWidget {
/// Widget name.
///
/// **Default**: `null`
name: Option<String>,
/// Widget class name.
///
/// **Default**: `null`
class: Option<String>,
/// Orientation of the slider.
///
/// **Valid options**: `horizontal`, `vertical`, `h`, `v`
/// <br />
/// **Default**: `horizontal`
#[serde(default)]
orientation: ModuleOrientation,
/// Script to run to get the slider value.
/// Output must be a valid number.
///
/// **Default**: `null`
value: Option<ScriptInput>,
/// Command to execute when the slider changes.
/// More on this [below](#slider).
///
/// Note that this will provide the floating point value as an argument.
/// If your input program requires an integer, you will need to round it.
///
/// **Default**: `null`
on_change: Option<String>,
/// Minimum slider value.
///
/// **Default**: `0`
#[serde(default = "default_min")]
min: f64,
/// Maximum slider value.
///
/// **Default**: `100`
#[serde(default = "default_max")]
max: f64,
/// If the increment to change when scrolling with the mousewheel.
/// If left blank, GTK will use the default value,
/// determined by the current environment.
///
/// **Default**: `null`
step: Option<f64>,
/// The slider length.
/// GTK will automatically determine the size if left blank.
///
/// **Default**: `null`
length: Option<i32>,
/// Whether to show the value label above the slider.
///
/// **Default**: `true`
#[serde(default = "crate::config::default_true")]
show_label: bool,
}