summaryrefslogtreecommitdiffstats
path: root/runtime/src
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/src')
-rw-r--r--runtime/src/command/action.rs8
-rw-r--r--runtime/src/window/action.rs11
2 files changed, 15 insertions, 4 deletions
diff --git a/runtime/src/command/action.rs b/runtime/src/command/action.rs
index 6c74f0ef..b2594379 100644
--- a/runtime/src/command/action.rs
+++ b/runtime/src/command/action.rs
@@ -22,7 +22,7 @@ pub enum Action<T> {
Clipboard(clipboard::Action<T>),
/// Run a window action.
- Window(window::Action<T>),
+ Window(window::Id, window::Action<T>),
/// Run a system action.
System(system::Action<T>),
@@ -57,7 +57,7 @@ impl<T> Action<T> {
match self {
Self::Future(future) => Action::Future(Box::pin(future.map(f))),
Self::Clipboard(action) => Action::Clipboard(action.map(f)),
- Self::Window(window) => Action::Window(window.map(f)),
+ Self::Window(id, window) => Action::Window(id, window.map(f)),
Self::System(system) => Action::System(system.map(f)),
Self::Widget(operation) => {
Action::Widget(Box::new(widget::operation::map(operation, f)))
@@ -77,7 +77,9 @@ impl<T> fmt::Debug for Action<T> {
Self::Clipboard(action) => {
write!(f, "Action::Clipboard({action:?})")
}
- Self::Window(action) => write!(f, "Action::Window({action:?})"),
+ Self::Window(id, action) => {
+ write!(f, "Action::Window({id:?}, {action:?})")
+ }
Self::System(action) => write!(f, "Action::System({action:?})"),
Self::Widget(_action) => write!(f, "Action::Widget"),
Self::LoadFont { .. } => write!(f, "Action::LoadFont"),
diff --git a/runtime/src/window/action.rs b/runtime/src/window/action.rs
index b6964e36..cebec4ae 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, UserAttention, Settings};
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 with the provided [`window::Settings`].
+ 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) => {