Restructure action macro to assign a namespace to every action

Also, allow arbitrary types to be used as Actions via the impl_actions macro

Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Keith Simmons <keith@zed.dev>
This commit is contained in:
Max Brunsfeld 2022-04-07 16:20:49 -07:00
parent 206b0f0f8c
commit 5242a3a6dc
33 changed files with 432 additions and 306 deletions

View file

@ -1,7 +1,7 @@
use super::{CursorStyle, WindowBounds};
use crate::{
geometry::vector::{vec2f, Vector2F},
AnyAction, ClipboardItem,
Action, ClipboardItem,
};
use anyhow::{anyhow, Result};
use parking_lot::Mutex;
@ -72,7 +72,7 @@ impl super::ForegroundPlatform for ForegroundPlatform {
unimplemented!()
}
fn on_menu_command(&self, _: Box<dyn FnMut(&dyn AnyAction)>) {}
fn on_menu_command(&self, _: Box<dyn FnMut(&dyn Action)>) {}
fn set_menus(&self, _: Vec<crate::Menu>) {}