Add RequestUserAttention to window::Action

This commit is contained in:
Night_Hunter 2022-12-10 01:53:00 +13:00 committed by Héctor Ramón Jiménez
parent 54105a24e1
commit d95b9bf244
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
4 changed files with 64 additions and 11 deletions

View file

@ -657,12 +657,6 @@ pub fn run_command<A, E>(
mode,
));
}
window::Action::ToggleMaximize => {
window.set_maximized(!window.is_maximized())
}
window::Action::ToggleDecorations => {
window.set_decorations(!window.is_decorated())
}
window::Action::FetchMode(tag) => {
let mode = if window.is_visible().unwrap_or(true) {
conversion::mode(window.fullscreen())
@ -674,6 +668,22 @@ pub fn run_command<A, E>(
.send_event(tag(mode))
.expect("Send message to event loop");
}
window::Action::ToggleMaximize => {
window.set_maximized(!window.is_maximized())
}
window::Action::ToggleDecorations => {
window.set_decorations(!window.is_decorated())
}
window::Action::RequestUserAttention(attention_type) => window
.request_user_attention(match attention_type {
Some(window::UserAttention::Critical) => {
Some(winit::window::UserAttentionType::Critical)
}
Some(window::UserAttention::Informational) => Some(
winit::window::UserAttentionType::Informational,
),
None => None,
}),
},
command::Action::System(action) => match action {
system::Action::QueryInformation(_tag) => {