add always on top action
This commit is contained in:
parent
871f59f3be
commit
d1d13f6f16
2 changed files with 13 additions and 0 deletions
|
|
@ -70,6 +70,12 @@ pub enum Action<T> {
|
|||
///
|
||||
/// - **Web / Wayland:** Unsupported.
|
||||
GainFocus,
|
||||
/// Change whether or not the window will always be on top of other windows.
|
||||
///
|
||||
/// ## Platform-specific
|
||||
///
|
||||
/// - **iOS / Android / Web / Wayland:** Unsupported.
|
||||
AlwaysOnTop(bool),
|
||||
}
|
||||
|
||||
impl<T> Action<T> {
|
||||
|
|
@ -96,6 +102,7 @@ impl<T> Action<T> {
|
|||
Action::RequestUserAttention(attention_type)
|
||||
}
|
||||
Self::GainFocus => Action::GainFocus,
|
||||
Self::AlwaysOnTop(bool) => Action::AlwaysOnTop(bool),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -122,6 +129,9 @@ impl<T> fmt::Debug for Action<T> {
|
|||
write!(f, "Action::RequestUserAttention")
|
||||
}
|
||||
Self::GainFocus => write!(f, "Action::GainFocus"),
|
||||
Self::AlwaysOnTop(value) => {
|
||||
write!(f, "Action::AlwaysOnTop({})", value)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -788,6 +788,9 @@ pub fn run_command<A, E>(
|
|||
user_attention.map(conversion::user_attention),
|
||||
),
|
||||
window::Action::GainFocus => window.focus_window(),
|
||||
window::Action::AlwaysOnTop(value) => {
|
||||
window.set_always_on_top(value)
|
||||
}
|
||||
},
|
||||
command::Action::System(action) => match action {
|
||||
system::Action::QueryInformation(_tag) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue