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