From db65c6904d38fe37ad0c31a11242d55f5f773c94 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 17 Feb 2023 13:24:46 +0100 Subject: Expose `change_always_on_top` helper in `window` module --- winit/src/window.rs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/winit/src/window.rs b/winit/src/window.rs index 6e3a383a..3d5a765b 100644 --- a/winit/src/window.rs +++ b/winit/src/window.rs @@ -23,13 +23,17 @@ pub fn resize(width: u32, height: u32) -> Command { } /// Maximizes the window. -pub fn maximize(value: bool) -> Command { - Command::single(command::Action::Window(window::Action::Maximize(value))) +pub fn maximize(maximized: bool) -> Command { + Command::single(command::Action::Window(window::Action::Maximize( + maximized, + ))) } /// Minimes the window. -pub fn minimize(value: bool) -> Command { - Command::single(command::Action::Window(window::Action::Minimize(value))) +pub fn minimize(minimized: bool) -> Command { + Command::single(command::Action::Window(window::Action::Minimize( + minimized, + ))) } /// Moves a window to the given logical coordinates. @@ -84,3 +88,10 @@ pub fn request_user_attention( pub fn gain_focus() -> Command { Command::single(command::Action::Window(window::Action::GainFocus)) } + +/// Changes whether or not the window will always be on top of other windows. +pub fn change_always_on_top(on_top: bool) -> Command { + Command::single(command::Action::Window(window::Action::ChangeAlwaysOnTop( + on_top, + ))) +} -- cgit