Add option to make the transparent window blurry

This commit is contained in:
rhysd 2025-01-13 22:02:57 +09:00 committed by Héctor Ramón Jiménez
parent 2bbc7385e0
commit 8f346ac220
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
2 changed files with 14 additions and 0 deletions

View file

@ -62,6 +62,18 @@ pub struct Settings {
/// Whether the window should be transparent.
pub transparent: bool,
/// Whether the window should have blurry background.
///
/// Note that the blurry effect is applied to the transparent window. You need to enable
/// [`Settings::transparent`] and set a proper opacity value to the background color with
/// `Application::style`.
///
/// This option is only supported on macOS and Linux. Please read the [winit document][winit]
/// for more details.
///
/// [winit]: https://docs.rs/winit/latest/winit/window/struct.Window.html#method.set_blur
pub blur: bool,
/// The window [`Level`].
pub level: Level,
@ -95,6 +107,7 @@ impl Default for Settings {
resizable: true,
decorations: true,
transparent: false,
blur: false,
level: Level::default(),
icon: None,
exit_on_close_request: true,