1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-27 15:13:12 -04:00

Added is_desktop checkbox in egui_demo_app

Fix window not rendering if is_desktop is false
This commit is contained in:
Konkitoman
2023-07-25 12:15:37 +03:00
parent 08b3afdc5e
commit 55a0f1f0c3
2 changed files with 6 additions and 1 deletions

View File

@@ -469,7 +469,7 @@ impl<'open> Window<'open> {
// let is_explicitly_closed = matches!(open, Some(false));
let is_open = is_open || ctx.memory(|mem| mem.everything_is_visible());
'create_viewport: {
if !embedded {
if !embedded && ctx.is_desktop() {
if !is_open {
return;
}

View File

@@ -173,6 +173,11 @@ impl BackendPanel {
frame.set_fullscreen(fullscreen);
}
}
{
let mut is_desktop = ui.ctx().is_desktop();
ui.checkbox(&mut is_desktop, "Is Desktop");
ui.ctx().set_desktop(is_desktop);
}
if ui
.button("📱 Phone Size")