diff --git a/Cargo.lock b/Cargo.lock index cad302225..8a224ae14 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2159,7 +2159,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi 0.3.2", - "rustix 0.38.10", + "rustix 0.38.11", "windows-sys 0.48.0", ] @@ -3244,9 +3244,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.10" +version = "0.38.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6248e1caa625eb708e266e06159f135e8c26f2bb7ceb72dc4b2766d0340964" +checksum = "c0c3dde1fc030af041adc40e79c0e7fbcf431dd24870053d187d7c66e4b87453" dependencies = [ "bitflags 2.4.0", "errno", @@ -3695,7 +3695,7 @@ dependencies = [ "cfg-if", "fastrand 2.0.0", "redox_syscall 0.3.5", - "rustix 0.38.10", + "rustix 0.38.11", "windows-sys 0.48.0", ] diff --git a/crates/eframe/src/epi/mod.rs b/crates/eframe/src/epi/mod.rs index a1d3d7cd1..6172bf42e 100644 --- a/crates/eframe/src/epi/mod.rs +++ b/crates/eframe/src/epi/mod.rs @@ -203,7 +203,7 @@ pub trait App { // NOTE: a bright gray makes the shadows of the windows look weird. // We use a bit of transparency so that if the user switches on the // `transparent()` option they get immediate results. - egui::Color32::from_rgba_unmultiplied(12, 12, 12, 0).to_normalized_gamma_f32() + egui::Color32::from_rgba_unmultiplied(12, 12, 12, 180).to_normalized_gamma_f32() // _visuals.window_fill() would also be a natural choice } @@ -499,7 +499,7 @@ impl Default for NativeOptions { min_window_size: None, max_window_size: None, resizable: true, - transparent: true, + transparent: false, mouse_passthrough: false, active: true, @@ -766,9 +766,6 @@ impl Frame { self.info.clone() } - /// If this is the main window will return true! - /// When is a single window mode will always return true! - /// A place where you can store custom data in a way that persists when you restart the app. pub fn storage(&self) -> Option<&dyn Storage> { self.storage.as_deref() diff --git a/crates/egui_demo_app/src/backend_panel.rs b/crates/egui_demo_app/src/backend_panel.rs index 64b08a7aa..6480756f2 100644 --- a/crates/egui_demo_app/src/backend_panel.rs +++ b/crates/egui_demo_app/src/backend_panel.rs @@ -171,11 +171,6 @@ impl BackendPanel { frame.set_fullscreen(fullscreen); } } - { - let mut force_embedding = ui.ctx().force_embedding(); - ui.checkbox(&mut force_embedding, "Force Embedding"); - ui.ctx().set_force_embedding(force_embedding); - } if ui .button("📱 Phone Size") @@ -398,39 +393,34 @@ impl EguiWindows { output_event_history, } = self; - { - ctx.output(|o| { - for event in &o.events { - output_event_history.push_back(event.clone()); - } - }); - while output_event_history.len() > 1000 { - output_event_history.pop_front(); + ctx.output(|o| { + for event in &o.events { + output_event_history.push_back(event.clone()); } + }); + while output_event_history.len() > 1000 { + output_event_history.pop_front(); } - let tmp_ctx = ctx.clone(); egui::Window::new("🔧 Settings") .open(settings) .vscroll(true) .show(ctx, |ui| { - tmp_ctx.settings_ui(ui); + ctx.settings_ui(ui); }); - let tmp_ctx = ctx.clone(); egui::Window::new("🔍 Inspection") .open(inspection) .vscroll(true) .show(ctx, |ui| { - tmp_ctx.inspection_ui(ui); + ctx.inspection_ui(ui); }); - let tmp_ctx = ctx.clone(); egui::Window::new("📝 Memory") .open(memory) .resizable(false) .show(ctx, |ui| { - tmp_ctx.memory_ui(ui); + ctx.memory_ui(ui); }); egui::Window::new("📤 Output Events") diff --git a/crates/egui_demo_app/src/wrap_app.rs b/crates/egui_demo_app/src/wrap_app.rs index 713a9eed2..84581d563 100644 --- a/crates/egui_demo_app/src/wrap_app.rs +++ b/crates/egui_demo_app/src/wrap_app.rs @@ -447,14 +447,12 @@ impl WrapApp { }); // Show dropped files (if any): - let is_empty = self.dropped_files.is_empty(); - if !is_empty { + if !self.dropped_files.is_empty() { let mut open = true; - let dropped_files = self.dropped_files.clone(); egui::Window::new("Dropped files") .open(&mut open) .show(ctx, |ui| { - for file in &dropped_files { + for file in &self.dropped_files { let mut info = if let Some(path) = &file.path { path.display().to_string() } else if !file.name.is_empty() { diff --git a/docs/egui_demo_app_bg.wasm b/docs/egui_demo_app_bg.wasm index 39b5f2e81..aaf856279 100644 Binary files a/docs/egui_demo_app_bg.wasm and b/docs/egui_demo_app_bg.wasm differ diff --git a/examples/hello_world_simple/src/main.rs b/examples/hello_world_simple/src/main.rs index 04d3f6aef..bc815738b 100644 --- a/examples/hello_world_simple/src/main.rs +++ b/examples/hello_world_simple/src/main.rs @@ -1,6 +1,6 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -use eframe::egui::{self}; +use eframe::egui; fn main() -> Result<(), eframe::Error> { env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`). diff --git a/examples/puffin_profiler/src/main.rs b/examples/puffin_profiler/src/main.rs index c947456e2..f8d52e91c 100644 --- a/examples/puffin_profiler/src/main.rs +++ b/examples/puffin_profiler/src/main.rs @@ -1,6 +1,6 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -use eframe::egui::{self}; +use eframe::egui; fn main() -> Result<(), eframe::Error> { env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`). diff --git a/examples/retained_image/src/main.rs b/examples/retained_image/src/main.rs index 22f66142e..f96fb9642 100644 --- a/examples/retained_image/src/main.rs +++ b/examples/retained_image/src/main.rs @@ -1,6 +1,6 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -use eframe::egui::{self}; +use eframe::egui; use egui_extras::RetainedImage; fn main() -> Result<(), eframe::Error> { diff --git a/examples/save_plot/src/main.rs b/examples/save_plot/src/main.rs index ae6c5192c..c9adf1ec9 100644 --- a/examples/save_plot/src/main.rs +++ b/examples/save_plot/src/main.rs @@ -1,7 +1,7 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release +use eframe::egui; use eframe::egui::ColorImage; -use eframe::egui::{self}; use egui_plot::{Legend, Line, Plot, PlotPoints}; fn main() -> Result<(), eframe::Error> { diff --git a/examples/serial_windows/src/main.rs b/examples/serial_windows/src/main.rs index e811dee08..5e85d6467 100644 --- a/examples/serial_windows/src/main.rs +++ b/examples/serial_windows/src/main.rs @@ -1,6 +1,6 @@ #![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release -use eframe::egui::{self}; +use eframe::egui; fn main() -> Result<(), eframe::Error> { env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`).