summaryrefslogtreecommitdiffstats
path: root/winit/src/window.rs
diff options
context:
space:
mode:
authorLibravatar Bingus <shankern@protonmail.com>2023-02-17 11:45:34 -0800
committerLibravatar Bingus <shankern@protonmail.com>2023-02-17 11:45:34 -0800
commit744cef5608a91fe55cbbe1adb73a9a0b5e266668 (patch)
treef88ca6ae3c481e2de74178bb3f0d1f1b685e1740 /winit/src/window.rs
parent8da098330b58542cc929f4f24d02e26bd654bae4 (diff)
parent7dc1fb488ddbd12519571b51d75ae0c28875911d (diff)
downloadiced-744cef5608a91fe55cbbe1adb73a9a0b5e266668.tar.gz
iced-744cef5608a91fe55cbbe1adb73a9a0b5e266668.tar.bz2
iced-744cef5608a91fe55cbbe1adb73a9a0b5e266668.zip
Merge remote-tracking branch 'origin/master' into feat/multi-window-support
# Conflicts: # winit/src/window.rs
Diffstat (limited to 'winit/src/window.rs')
-rw-r--r--winit/src/window.rs25
1 files changed, 21 insertions, 4 deletions
diff --git a/winit/src/window.rs b/winit/src/window.rs
index 97d80c38..88cd3f14 100644
--- a/winit/src/window.rs
+++ b/winit/src/window.rs
@@ -38,18 +38,18 @@ pub fn resize<Message>(
}
/// Maximizes the window.
-pub fn maximize<Message>(id: window::Id, value: bool) -> Command<Message> {
+pub fn maximize<Message>(id: window::Id, maximized: bool) -> Command<Message> {
Command::single(command::Action::Window(
id,
- window::Action::Maximize(value),
+ window::Action::Maximize(maximized),
))
}
/// Minimes the window.
-pub fn minimize<Message>(id: window::Id, value: bool) -> Command<Message> {
+pub fn minimize<Message>(id: window::Id, minimized: bool) -> Command<Message> {
Command::single(command::Action::Window(
id,
- window::Action::Minimize(value),
+ window::Action::Minimize(minimized),
))
}
@@ -109,3 +109,20 @@ pub fn request_user_attention<Message>(
pub fn gain_focus<Message>(id: window::Id) -> Command<Message> {
Command::single(command::Action::Window(id, window::Action::GainFocus))
}
+
+/// Changes whether or not the window will always be on top of other windows.
+pub fn change_always_on_top<Message>(id: window::Id, on_top: bool) -> Command<Message> {
+ Command::single(command::Action::Window(id, window::Action::ChangeAlwaysOnTop(
+ on_top,
+ )))
+}
+
+/// Fetches an identifier unique to the window.
+pub fn fetch_id<Message>(
+ id: window::Id,
+ f: impl FnOnce(u64) -> Message + 'static,
+) -> Command<Message> {
+ Command::single(command::Action::Window(id: window::Id, window::Action::FetchId(Box::new(
+ f,
+ ))))
+}