Description
I‘m trying to use WindowConfig to set the background of the window to transparent with with_transparent(true),but I found this option is not working at all.
After checking the layout with the Inspector, I noticed that the root view named "Window" is using a default theme which has a property setting the background color to black.
Expected Behavior
I think it would be better if this color option could switch to transparent automatically when a transparent configuration is applied to the window.
Environment
The dependency I'm using is pulled directly from the main branch at commit 348b02c which includes the recent PR #1059
Dependencies:
floem = { git = "https://github.com/lapce/floem.git", branch = "main" }
Code:
use floem::peniko::{Brush, Color};
use floem::prelude::Decorators;
use floem::views::{Button, Label, Stack};
use floem::window::{WinOsBackdropType, WindowConfig, WindowId};
use floem::{Application, IntoView};
use std::str::FromStr;
fn app_view(window_id: WindowId) -> impl IntoView {
Stack::vertical((
Label::new("Hello, Floem!"),
Button::new("Inspector")
.action(floem::action::inspect)
))
.style(|s| s
.padding_top(32.)
.background(Brush::Solid(Color::from_str("#ff980099").unwrap()))
.height_full()
)
}
fn main() {
let app = Application::new();
let window_config = WindowConfig::default()
.with_transparent(true)
.show_titlebar(false)
.with_win_os_config(|config| config
.set_system_backdrop(WinOsBackdropType::TransientWindow)
)
.with_mac_os_config(|config| config
.movable_by_window_background(true)
.transparent_title_bar(true)
.full_size_content_view(true)
.hide_title(true)
);
app.window(app_view, Some(window_config)).run();
}
Description
I‘m trying to use
WindowConfigto set the background of the window to transparent withwith_transparent(true),but I found this option is not working at all.After checking the layout with the Inspector, I noticed that the root view named "Window" is using a default theme which has a property setting the background color to black.
Expected Behavior
I think it would be better if this color option could switch to transparent automatically when a transparent configuration is applied to the window.
Environment
The dependency I'm using is pulled directly from the main branch at commit 348b02c which includes the recent PR #1059
Dependencies:
floem = { git = "https://github.com/lapce/floem.git", branch = "main" }Code: