diff options
Diffstat (limited to 'native/src/window/action.rs')
-rw-r--r-- | native/src/window/action.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/native/src/window/action.rs b/native/src/window/action.rs index ce36d129..5751bf97 100644 --- a/native/src/window/action.rs +++ b/native/src/window/action.rs @@ -1,4 +1,4 @@ -use crate::window::{Mode, UserAttention}; +use crate::window::{Mode, UserAttention, Settings}; use iced_futures::MaybeSend; use std::fmt; @@ -13,6 +13,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 with the provided [`window::Settings`]. + Spawn { + /// The settings of the [`Window`]. + settings: Settings, + }, /// Resize the window. Resize { /// The new logical width of the window @@ -90,6 +95,7 @@ impl<T> Action<T> { T: 'static, { match self { + Self::Spawn { settings } => Action::Spawn { settings }, Self::Close => Action::Close, Self::Drag => Action::Drag, Self::Resize { width, height } => Action::Resize { width, height }, @@ -117,6 +123,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 { width, height } => write!( f, "Action::Resize {{ widget: {width}, height: {height} }}" |