Files
notedeck/crates/notedeck_chrome/src/app.rs
William Casarin e8a1233174 dave: bubble note actions to chrome
This allows chrome to pass note actions to other apps
2025-04-22 18:42:12 -07:00

20 lines
551 B
Rust

use notedeck::{AppAction, AppContext};
use notedeck_columns::Damus;
use notedeck_dave::Dave;
pub enum NotedeckApp {
Dave(Dave),
Columns(Damus),
Other(Box<dyn notedeck::App>),
}
impl notedeck::App for NotedeckApp {
fn update(&mut self, ctx: &mut AppContext, ui: &mut egui::Ui) -> Option<AppAction> {
match self {
NotedeckApp::Dave(dave) => dave.update(ctx, ui),
NotedeckApp::Columns(columns) => columns.update(ctx, ui),
NotedeckApp::Other(other) => other.update(ctx, ui),
}
}
}