remove modules and have single event manager (atomics feature parity + preparation for local state)

This commit is contained in:
2025-12-12 01:46:24 -05:00
parent a708813ce7
commit 37b1987aa8
17 changed files with 390 additions and 432 deletions

View File

@@ -11,12 +11,14 @@ mod attr;
mod event;
mod input;
mod render;
mod sense;
pub use app::*;
pub use attr::*;
pub use event::*;
pub use input::*;
pub use render::*;
pub use sense::*;
pub type Proxy<Event> = EventLoopProxy<Event>;
pub type DefaultApp<Data> = App<DefaultState<Data>>;
@@ -131,13 +133,13 @@ impl<State: DefaultAppState> AppState for DefaultState<State> {
ui_state.window.set_ime_allowed(false);
}
TextInputResult::Submit => {
ui.run_event(app_state, sel, Submit, ());
ui.run_event::<Submit, _>(app_state, sel, &mut ());
}
TextInputResult::Paste => {
if let Ok(t) = ui_state.clipboard.get_text() {
text.insert(&t);
}
ui.run_event(app_state, sel, Edited, ());
ui.run_event::<Edited, _>(app_state, sel, &mut ());
}
TextInputResult::Copy(text) => {
if let Err(err) = ui_state.clipboard.set_text(text) {
@@ -145,7 +147,7 @@ impl<State: DefaultAppState> AppState for DefaultState<State> {
}
}
TextInputResult::Used => {
ui.run_event(app_state, sel, Edited, ());
ui.run_event::<Edited, _>(app_state, sel, &mut ());
}
TextInputResult::Unused => {}
}