diff options
author | 2023-02-22 21:23:04 +0100 | |
---|---|---|
committer | 2023-02-22 21:23:04 +0100 | |
commit | 4f41927155e7d4bc38497b0e298a0b23ccea6ca1 (patch) | |
tree | 70b7dbc1afdc62dfeaf42f0c62e8f4c01e407729 /winit/src/window.rs | |
parent | a35d6d2e4d59f71309f31c87ea5150959d639185 (diff) | |
parent | 666f3cd143047e49a010f0c97eabc7136f92aa35 (diff) | |
download | iced-4f41927155e7d4bc38497b0e298a0b23ccea6ca1.tar.gz iced-4f41927155e7d4bc38497b0e298a0b23ccea6ca1.tar.bz2 iced-4f41927155e7d4bc38497b0e298a0b23ccea6ca1.zip |
Merge branch 'iced-rs:master' into master
Diffstat (limited to 'winit/src/window.rs')
-rw-r--r-- | winit/src/window.rs | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/winit/src/window.rs b/winit/src/window.rs index 6e3a383a..961562bd 100644 --- a/winit/src/window.rs +++ b/winit/src/window.rs @@ -23,13 +23,17 @@ pub fn resize<Message>(width: u32, height: u32) -> Command<Message> { } /// Maximizes the window. -pub fn maximize<Message>(value: bool) -> Command<Message> { - Command::single(command::Action::Window(window::Action::Maximize(value))) +pub fn maximize<Message>(maximized: bool) -> Command<Message> { + Command::single(command::Action::Window(window::Action::Maximize( + maximized, + ))) } /// Minimes the window. -pub fn minimize<Message>(value: bool) -> Command<Message> { - Command::single(command::Action::Window(window::Action::Minimize(value))) +pub fn minimize<Message>(minimized: bool) -> Command<Message> { + Command::single(command::Action::Window(window::Action::Minimize( + minimized, + ))) } /// Moves a window to the given logical coordinates. @@ -84,3 +88,19 @@ pub fn request_user_attention<Message>( pub fn gain_focus<Message>() -> Command<Message> { 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<Message>(on_top: bool) -> Command<Message> { + Command::single(command::Action::Window(window::Action::ChangeAlwaysOnTop( + on_top, + ))) +} + +/// Fetches an identifier unique to the window. +pub fn fetch_id<Message>( + f: impl FnOnce(u64) -> Message + 'static, +) -> Command<Message> { + Command::single(command::Action::Window(window::Action::FetchId(Box::new( + f, + )))) +} |