mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-07-03 03:31:03 +02:00
feat: new label module
Takes a text label, with the ability to include embedded scripts. Resolves #80.
This commit is contained in:
parent
55c06c4766
commit
6c622864b3
11 changed files with 153 additions and 1 deletions
|
@ -10,9 +10,12 @@ enum DynamicStringSegment {
|
|||
Dynamic(Script),
|
||||
}
|
||||
|
||||
/// A string with embedded scripts for dynamic content.
|
||||
pub struct DynamicString;
|
||||
|
||||
impl DynamicString {
|
||||
/// Creates a new dynamic string, based off the input template.
|
||||
/// Runs `f` with the compiled string each time one of the scripts updates.
|
||||
pub fn new<F>(input: &str, f: F) -> Self
|
||||
where
|
||||
F: FnMut(String) -> Continue + 'static,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue