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

feat(custom): option to toggle slider label

Adds new `show_label` option.

Resolves #115 (for real this time).
This commit is contained in:
Jake Stanger 2023-04-23 12:59:28 +01:00
parent dc16b1e15a
commit 033d0f7e6e
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
2 changed files with 4 additions and 0 deletions

View file

@ -24,6 +24,8 @@ pub struct SliderWidget {
max: f64,
step: Option<f64>,
length: Option<i32>,
#[serde(default = "crate::config::default_true")]
show_label: bool,
}
const fn default_min() -> f64 {
@ -51,6 +53,7 @@ impl CustomWidget for SliderWidget {
}
scale.set_range(self.min, self.max);
scale.set_draw_value(self.show_label);
if let Some(on_change) = self.on_change {
let min = self.min;