diff options
Diffstat (limited to 'runtime/src/window.rs')
-rw-r--r-- | runtime/src/window.rs | 22 |
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))) |