summaryrefslogtreecommitdiffstats
path: root/native/src
diff options
context:
space:
mode:
authorLibravatar Night_Hunter <samuelhuntnz@gmail.com>2022-12-10 01:40:53 +1300
committerLibravatar Night_Hunter <samuelhuntnz@gmail.com>2022-12-10 01:40:53 +1300
commit750fecd6bca293fa891fbdfbf6c7052c49e3fd12 (patch)
treefaa3751b78b2619d81dec7f705674fd687c41da0 /native/src
parent7ceb8b8d406cb72ea0e0c341ad755d69165d95f9 (diff)
downloadiced-750fecd6bca293fa891fbdfbf6c7052c49e3fd12.tar.gz
iced-750fecd6bca293fa891fbdfbf6c7052c49e3fd12.tar.bz2
iced-750fecd6bca293fa891fbdfbf6c7052c49e3fd12.zip
add toggle decorations action
Diffstat (limited to 'native/src')
-rw-r--r--native/src/window/action.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/native/src/window/action.rs b/native/src/window/action.rs
index 009dcc27..f731be19 100644
--- a/native/src/window/action.rs
+++ b/native/src/window/action.rs
@@ -35,6 +35,11 @@ pub enum Action<T> {
SetMode(Mode),
/// Sets the window to maximized or back
ToggleMaximize,
+ /// Toggles whether window has decorations
+ /// ## Platform-specific
+ /// - **X11:** Not implemented.
+ /// - **iOS / Android / Web:** Unsupported.
+ ToggleDecorations,
/// Fetch the current [`Mode`] of the window.
FetchMode(Box<dyn FnOnce(Mode) -> T + 'static>),
}
@@ -56,6 +61,7 @@ impl<T> Action<T> {
Self::Move { x, y } => Action::Move { x, y },
Self::SetMode(mode) => Action::SetMode(mode),
Self::ToggleMaximize => Action::ToggleMaximize,
+ Self::ToggleDecorations => Action::ToggleDecorations,
Self::FetchMode(o) => Action::FetchMode(Box::new(move |s| f(o(s)))),
}
}
@@ -77,6 +83,7 @@ impl<T> fmt::Debug for Action<T> {
}
Self::SetMode(mode) => write!(f, "Action::SetMode({:?})", mode),
Self::ToggleMaximize => write!(f, "Action::ToggleMaximize"),
+ Self::ToggleDecorations => write!(f, "Action::ToggleDecorations"),
Self::FetchMode(_) => write!(f, "Action::FetchMode"),
}
}