app.rs (733B)
1 use notedeck::{AppAction, AppContext}; 2 use notedeck_columns::Damus; 3 use notedeck_dave::Dave; 4 use notedeck_notebook::Notebook; 5 6 #[allow(clippy::large_enum_variant)] 7 pub enum NotedeckApp { 8 Dave(Box<Dave>), 9 Columns(Box<Damus>), 10 Notebook(Box<Notebook>), 11 Other(Box<dyn notedeck::App>), 12 } 13 14 impl notedeck::App for NotedeckApp { 15 fn update(&mut self, ctx: &mut AppContext, ui: &mut egui::Ui) -> Option<AppAction> { 16 match self { 17 NotedeckApp::Dave(dave) => dave.update(ctx, ui), 18 NotedeckApp::Columns(columns) => columns.update(ctx, ui), 19 NotedeckApp::Notebook(notebook) => notebook.update(ctx, ui), 20 NotedeckApp::Other(other) => other.update(ctx, ui), 21 } 22 } 23 }