diff options
author | 2024-01-09 02:37:45 -0600 | |
---|---|---|
committer | 2024-01-09 02:43:25 -0600 | |
commit | 2aa2b1712dfdc93762ebe0958614154920068731 (patch) | |
tree | 96b93b09e8ba5ea28db50a2d525e0639c8a4bca5 /runtime/src/window.rs | |
parent | 6c9dfbf01ec865f2ccf3b33cc8902d4e7141cd4f (diff) | |
download | iced-2aa2b1712dfdc93762ebe0958614154920068731.tar.gz iced-2aa2b1712dfdc93762ebe0958614154920068731.tar.bz2 iced-2aa2b1712dfdc93762ebe0958614154920068731.zip |
Implemented fetch_maximized and fetch_minimized
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))) |