summaryrefslogtreecommitdiffstats
path: root/runtime/src/window.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-16 12:02:42 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-16 12:02:42 +0100
commit534c7dd7b0bc515c31b6de87b4aa6a35b44c46a0 (patch)
tree0ddc8f1b681cbade7e47293bd46a362896aa538a /runtime/src/window.rs
parent17135cbd56316f31167eb62e026839450506573f (diff)
parentc4ba657de86d7606587dad5124f435141258f570 (diff)
downloadiced-534c7dd7b0bc515c31b6de87b4aa6a35b44c46a0.tar.gz
iced-534c7dd7b0bc515c31b6de87b4aa6a35b44c46a0.tar.bz2
iced-534c7dd7b0bc515c31b6de87b4aa6a35b44c46a0.zip
Merge branch 'master' into update-winit
Diffstat (limited to 'runtime/src/window.rs')
-rw-r--r--runtime/src/window.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/runtime/src/window.rs b/runtime/src/window.rs
index f9d943f6..2136d64d 100644
--- a/runtime/src/window.rs
+++ b/runtime/src/window.rs
@@ -65,11 +65,33 @@ pub fn fetch_size<Message>(
Command::single(command::Action::Window(Action::FetchSize(id, Box::new(f))))
}
+/// Fetches if the window is maximized.
+pub fn fetch_maximized<Message>(
+ id: Id,
+ f: impl FnOnce(bool) -> Message + 'static,
+) -> Command<Message> {
+ Command::single(command::Action::Window(Action::FetchMaximized(
+ id,
+ Box::new(f),
+ )))
+}
+
/// Maximizes the window.
pub fn maximize<Message>(id: Id, maximized: bool) -> Command<Message> {
Command::single(command::Action::Window(Action::Maximize(id, maximized)))
}
+/// Fetches if the window is minimized.
+pub fn fetch_minimized<Message>(
+ id: Id,
+ f: impl FnOnce(Option<bool>) -> Message + 'static,
+) -> Command<Message> {
+ Command::single(command::Action::Window(Action::FetchMinimized(
+ id,
+ Box::new(f),
+ )))
+}
+
/// Minimizes the window.
pub fn minimize<Message>(id: Id, minimized: bool) -> Command<Message> {
Command::single(command::Action::Window(Action::Minimize(id, minimized)))