Add plumbing for event system (#52)

* Add plumbing for event system

* Apply review suggestions

* Add swap and reset color functions
This commit is contained in:
T0mstone
2021-03-28 23:39:33 +02:00
committed by GitHub
parent ea1f9f30f0
commit c437f1bd22
9 changed files with 352 additions and 210 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ use workspace::Workspace;
// TODO: serialize with serde to save the current editor state
pub struct Editor {
pub tools: ToolState,
tools: ToolState,
workspace: Workspace,
dispatcher: Dispatcher,
}
@@ -36,6 +36,6 @@ impl Editor {
}
}
pub fn handle_event(&mut self, event: events::Event) -> Result<(), EditorError> {
self.dispatcher.handle_event(event)
self.dispatcher.handle_event(&mut self.tools, event)
}
}