slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.12k stars 580 forks source link

feat: add first-class window effect support #4121

Open std-microblock opened 10 months ago

std-microblock commented 10 months ago

For each platform, some effects can be applied to transparent windows. I currently achieved this with DWM API calls. It's neat and should have official support for convenience and cross-platform compatibility.

Mica: image

Acrylic: image

Acrylic win10 API: image

ogoffart commented 8 months ago

This looks like something that winit support with set_blur 'https://docs.rs/winit/latest/winit/window/struct.Window.html#method.set_blur) But accessing the Winit Window is currently only possible with private api from i-slint-backend-winit crate.

std-microblock commented 8 months ago

This looks like something that winit support with set_blur 'docs.rs/winit/latest/winit/window/struct.Window.html#method.set_blur) But accessing the Winit Window is currently only possible with private api from i-slint-backend-winit crate.

There're actually multiple implementations of background effect for windows.

I suggest learning from electron, whose api is like 'window.effect = "acrylic";'