summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Richard <richardsoncusto@gmail.com>2022-10-19 23:33:20 -0300
committerLibravatar bungoboingo <shankern@protonmail.com>2023-01-09 11:27:04 -0800
commitf93fa0254329ebddca21ea1a79bd8ee6d8b4bdaf (patch)
tree3b3ae59caf9f67c0c5d58fb1aeb997bc91aecf99 /native
parent1bc0c480f9747826b244c30e92d8c4a29b576e4a (diff)
downloadiced-f93fa0254329ebddca21ea1a79bd8ee6d8b4bdaf.tar.gz
iced-f93fa0254329ebddca21ea1a79bd8ee6d8b4bdaf.tar.bz2
iced-f93fa0254329ebddca21ea1a79bd8ee6d8b4bdaf.zip
introduce `window::spawn` and `window::close`
Diffstat (limited to '')
-rw-r--r--native/src/window/action.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/native/src/window/action.rs b/native/src/window/action.rs
index 37fcc273..0587f25c 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::{self, Mode, UserAttention};
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,
+ /// TODO(derezzedex)
+ Spawn {
+ /// TODO(derezzedex)
+ settings: window::Settings,
+ },
/// Resize the window.
Resize {
/// The new logical width of the window
@@ -34,9 +39,9 @@ pub enum Action<T> {
y: i32,
},
/// Set the [`Mode`] of the window.
- SetMode(Mode),
+ SetMode(window::Mode),
/// Fetch the current [`Mode`] of the window.
- FetchMode(Box<dyn FnOnce(Mode) -> T + 'static>),
+ FetchMode(Box<dyn FnOnce(window::Mode) -> T + 'static>),
/// Sets the window to maximized or back
ToggleMaximize,
/// Toggles whether window has decorations
@@ -81,6 +86,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 },
@@ -104,6 +110,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: {}, height: {} }}",