Implemented fetch_maximized and fetch_minimized

This commit is contained in:
Calastrophe 2024-01-09 02:37:45 -06:00
parent 6c9dfbf01e
commit 2aa2b1712d
4 changed files with 69 additions and 0 deletions

View file

@ -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)))