diff options
Diffstat (limited to 'runtime/src/window/action.rs')
-rw-r--r-- | runtime/src/window/action.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/runtime/src/window/action.rs b/runtime/src/window/action.rs index b6964e36..d631cee1 100644 --- a/runtime/src/window/action.rs +++ b/runtime/src/window/action.rs @@ -1,4 +1,4 @@ -use crate::core::window::{Icon, Level, Mode, UserAttention}; +use crate::core::window::{Icon, Level, Mode, Settings, UserAttention}; use crate::core::Size; use crate::futures::MaybeSend; use crate::window::Screenshot; @@ -15,6 +15,11 @@ pub enum Action<T> { /// There’s no guarantee that this will work unless the left mouse /// button was pressed immediately before this function is called. Drag, + /// Spawns a new window. + Spawn { + /// The settings of the [`Window`]. + settings: Settings, + }, /// Resize the window. Resize(Size<u32>), /// Fetch the current size of the window. @@ -104,6 +109,7 @@ impl<T> Action<T> { match self { Self::Close => Action::Close, Self::Drag => Action::Drag, + Self::Spawn { settings } => Action::Spawn { settings }, Self::Resize(size) => Action::Resize(size), Self::FetchSize(o) => Action::FetchSize(Box::new(move |s| f(o(s)))), Self::Maximize(maximized) => Action::Maximize(maximized), @@ -134,6 +140,9 @@ impl<T> fmt::Debug for Action<T> { match self { Self::Close => write!(f, "Action::Close"), Self::Drag => write!(f, "Action::Drag"), + Self::Spawn { settings } => { + write!(f, "Action::Spawn {{ settings: {:?} }}", settings) + } Self::Resize(size) => write!(f, "Action::Resize({size:?})"), Self::FetchSize(_) => write!(f, "Action::FetchSize"), Self::Maximize(maximized) => { |