the core of loading slides from lisp is done

Slides themselves are capable of loading from lisp. The goal next will
be to create a way to load songs from lisp.
This commit is contained in:
Chris Cochrun 2024-11-20 12:13:50 -06:00
parent b49aa55ec3
commit 356384821b
4 changed files with 191 additions and 239 deletions

View file

@ -577,32 +577,6 @@ where
}
}
fn test_slide<'a>() -> Element<'a, Message> {
if let Ok(slide) = SlideBuilder::new()
.background(
Background::try_from("/home/chris/pics/frodo.jpg")
.unwrap(),
)
.text("This is a frodo")
.text_alignment(TextAlignment::TopCenter)
.font_size(50)
.font("Quicksand")
.build()
{
let font = Font::with_name("Noto Sans");
let stack = stack!(
image(slide.background().path.clone()),
text(slide.text())
.size(slide.font_size() as u16)
.font(font)
);
stack.into()
} else {
text("Slide is broken").into()
}
}
#[cfg(test)]
mod test {
use super::*;