improv: expose set_blur
This commit is contained in:
parent
ac9b0cd357
commit
344567dd8d
2 changed files with 14 additions and 0 deletions
|
|
@ -188,6 +188,8 @@ pub enum Action {
|
||||||
|
|
||||||
/// Recompute the layouts of all the windows.
|
/// Recompute the layouts of all the windows.
|
||||||
RelayoutAll,
|
RelayoutAll,
|
||||||
|
/// Set window blur.
|
||||||
|
SetBlur(bool),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A window managed by iced.
|
/// A window managed by iced.
|
||||||
|
|
@ -537,3 +539,10 @@ pub fn allow_automatic_tabbing<T>(enabled: bool) -> Task<T> {
|
||||||
enabled,
|
enabled,
|
||||||
)))
|
)))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Sets the blur effect for the window.
|
||||||
|
///
|
||||||
|
/// This is only supported on platforms that support window blur.
|
||||||
|
pub fn set_blur<Message>(enable: bool) -> Task<Message> {
|
||||||
|
task::effect(crate::Action::Window(Action::SetBlur(enable)))
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1960,6 +1960,11 @@ fn run_action<'a, P, C>(
|
||||||
window.raw.request_redraw();
|
window.raw.request_redraw();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
window::Action::SetBlur(enable) => {
|
||||||
|
for (_, window) in window_manager.iter_mut() {
|
||||||
|
window.raw.set_blur(enable);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
Action::System(action) => match action {
|
Action::System(action) => match action {
|
||||||
system::Action::GetInformation(_channel) => {
|
system::Action::GetInformation(_channel) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue