egui_demo_app: don't do a transparent native window
It doesn't work great on Mac
This commit is contained in:
parent
e1bcaeebe5
commit
da2ce58127
2 changed files with 1 additions and 13 deletions
|
@ -8,8 +8,6 @@ fn main() {
|
||||||
tracing_subscriber::fmt::init();
|
tracing_subscriber::fmt::init();
|
||||||
|
|
||||||
let options = eframe::NativeOptions {
|
let options = eframe::NativeOptions {
|
||||||
// Let's show off that we support transparent windows
|
|
||||||
transparent: true,
|
|
||||||
drag_and_drop_support: true,
|
drag_and_drop_support: true,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
|
|
|
@ -201,17 +201,7 @@ impl DemoWindows {
|
||||||
show_menu_bar(ui);
|
show_menu_bar(ui);
|
||||||
});
|
});
|
||||||
|
|
||||||
{
|
egui::CentralPanel::default().show(ctx, |_ui| {}); // just to paint a background for the windows to be on top of. Needed on web because of https://github.com/emilk/egui/issues/1548
|
||||||
let mut fill = ctx.style().visuals.extreme_bg_color;
|
|
||||||
if !cfg!(target_arch = "wasm32") {
|
|
||||||
// Native: WrapApp uses a transparent window, so let's show that off:
|
|
||||||
// NOTE: the OS compositor assumes "normal" blending, so we need to hack it:
|
|
||||||
let [r, g, b, _] = fill.to_array();
|
|
||||||
fill = egui::Color32::from_rgba_premultiplied(r, g, b, 180);
|
|
||||||
}
|
|
||||||
let frame = egui::Frame::none().fill(fill);
|
|
||||||
egui::CentralPanel::default().frame(frame).show(ctx, |_| {});
|
|
||||||
}
|
|
||||||
|
|
||||||
self.windows(ctx);
|
self.windows(ctx);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue