-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add blurring on MacOS, Windows and Linux (setup dependent) #2900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
I was just playing around with this PR. For some reason, I can only really see the blur effect when I use a dark background theme. I could be wrong, but it is my understanding that the actual app background color comes from the /// The default [`Style`] of a built-in [`Theme`].
pub fn default(theme: &Theme) -> Style {
let palette = theme.extended_palette();
Style {
background_color: palette.background.base.color,
text_color: palette.background.base.text,
}
}Below is a screenshot of a sample app if you run it with an impl App {
fn theme(&self) -> iced::Theme {
let default = iced::Theme::default();
let palette = iced::theme::Palette {
background: default.palette().background.scale_alpha(0.05),
..default.palette()
};
iced::Theme::custom("Transparent".to_string(), palette)
}
// ...
}The top one is what I get when the system theme is set to dark, bottom when set to light. |
|
@airstrike I know this was a while ago but have you looked into it any more since your comment? This actually isn't tied to blurring, it also happens on master and 0.13 with a transparent window. It's easy to test with the But if you set the background color to |
|
FWIW I get a similar issue on Windows, too, where the light background isn't transparent but the dark background is. I have a modified styling example in this branch to quickly play around with this (slider value affects background alpha). Also on Windows, a fully transparent background is still blurred whereas on mac, blur only kicks in with alpha > 0.0 (the latter is quite nice, would be great if that behavior could be achieved in windows too) |
|
@watsaig We likely need to pre-multiply the alpha in the final framebuffer. |

Extends #2728 to support Windows in addition to MacOS and Linux.