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

@@ -184,6 +184,7 @@ fn get_connection_icon(status: &RelayStatus) -> egui::Image<'static> {
mod preview {
use super::*;
use crate::test_data::sample_pool;
use notedeck::{App, AppContext};
pub struct RelayViewPreview {
pool: RelayPool,
@@ -197,8 +198,8 @@ mod preview {
}
}
impl View for RelayViewPreview {
fn ui(&mut self, ui: &mut egui::Ui) {
impl App for RelayViewPreview {
fn update(&mut self, _app: &mut AppContext<'_>, ui: &mut egui::Ui) {
self.pool.try_recv();
RelayView::new(RelayPoolManager::new(&mut self.pool)).ui(ui);
}