previews: run previews as notedeck apps

This allows ./preview to be a notedeck app runner. I am currently
using it for the ProfilePic app (which will because notedeck_viz)

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin
2024-12-20 15:39:26 -08:00
parent 475314da75
commit fcac49a0a5
19 changed files with 222 additions and 238 deletions

View File

@@ -58,10 +58,11 @@ fn delete_button() -> impl Widget {
mod preview {
use crate::{
deck_state::DeckState,
ui::{Preview, PreviewConfig, View},
ui::{Preview, PreviewConfig},
};
use super::EditDeckView;
use notedeck::{App, AppContext};
pub struct EditDeckPreview {
state: DeckState,
@@ -75,8 +76,8 @@ mod preview {
}
}
impl View for EditDeckPreview {
fn ui(&mut self, ui: &mut egui::Ui) {
impl App for EditDeckPreview {
fn update(&mut self, _app_ctx: &mut AppContext<'_>, ui: &mut egui::Ui) {
EditDeckView::new(&mut self.state).ui(ui);
}
}