app.rs (1015B)
1 use notedeck::{AppContext, AppResponse}; 2 use notedeck_clndash::ClnDash; 3 use notedeck_columns::Damus; 4 use notedeck_dave::Dave; 5 use notedeck_messages::MessagesApp; 6 use notedeck_notebook::Notebook; 7 8 #[allow(clippy::large_enum_variant)] 9 pub enum NotedeckApp { 10 Dave(Box<Dave>), 11 Columns(Box<Damus>), 12 Notebook(Box<Notebook>), 13 ClnDash(Box<ClnDash>), 14 Messages(Box<MessagesApp>), 15 Other(Box<dyn notedeck::App>), 16 } 17 18 impl notedeck::App for NotedeckApp { 19 #[profiling::function] 20 fn update(&mut self, ctx: &mut AppContext, ui: &mut egui::Ui) -> AppResponse { 21 match self { 22 NotedeckApp::Dave(dave) => dave.update(ctx, ui), 23 NotedeckApp::Columns(columns) => columns.update(ctx, ui), 24 NotedeckApp::Notebook(notebook) => notebook.update(ctx, ui), 25 NotedeckApp::ClnDash(clndash) => clndash.update(ctx, ui), 26 NotedeckApp::Messages(dms) => dms.update(ctx, ui), 27 NotedeckApp::Other(other) => other.update(ctx, ui), 28 } 29 } 30 }