feat: Add window minimize support

This commit is contained in:
Michael Aaron Murphy 2022-10-11 15:24:26 +02:00
parent 8a50836ffc
commit ac6e137be3
No known key found for this signature in database
GPG key ID: B2732D4240C9212C
3 changed files with 12 additions and 0 deletions

View file

@ -627,6 +627,9 @@ pub fn run_command<A, E>(
window::Action::Maximize(value) => {
window.set_maximized(value);
}
window::Action::Minimize(value) => {
window.set_minimized(value);
}
window::Action::Move { x, y } => {
window.set_outer_position(winit::dpi::LogicalPosition {
x,

View file

@ -22,6 +22,11 @@ pub fn maximize<Message>(value: bool) -> Command<Message> {
Command::single(command::Action::Window(window::Action::Maximize(value)))
}
/// Set the window to minimized or back.
pub fn minimize<Message>(value: bool) -> Command<Message> {
Command::single(command::Action::Window(window::Action::Minimize(value)))
}
/// Moves a window to the given logical coordinates.
pub fn move_to<Message>(x: i32, y: i32) -> Command<Message> {
Command::single(command::Action::Window(window::Action::Move { x, y }))