1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-04-19 19:34:24 +02:00

feat(custom): support dynamic strings on buttons

This commit is contained in:
Jake Stanger 2023-04-10 13:49:09 +01:00
parent 72b14b6c4e
commit a9d1233909
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61

View file

@ -28,12 +28,12 @@ impl CustomWidget for ButtonWidget {
if let Some(text) = self.label {
let label = Label::new(None);
label.set_use_markup(true);
label.set_markup(&text);
button.add(&label);
}
if let Some(class) = self.class {
button.style_context().add_class(&class);
DynamicString::new(&text, move |string| {
label.set_markup(&string);
Continue(true)
});
}
if let Some(exec) = self.on_click {