diff --git a/crates/eframe/Cargo.toml b/crates/eframe/Cargo.toml index 5fc34775..8e1c5f8b 100644 --- a/crates/eframe/Cargo.toml +++ b/crates/eframe/Cargo.toml @@ -11,7 +11,13 @@ readme = "README.md" repository = "https://github.com/emilk/egui/tree/master/crates/eframe" categories = ["gui", "game-development"] keywords = ["egui", "gui", "gamedev"] -include = ["../LICENSE-APACHE", "../LICENSE-MIT", "**/*.rs", "Cargo.toml"] +include = [ + "../LICENSE-APACHE", + "../LICENSE-MIT", + "**/*.rs", + "Cargo.toml", + "data/icon.png", +] [package.metadata.docs.rs] all-features = true diff --git a/crates/eframe/data/icon.png b/crates/eframe/data/icon.png new file mode 100644 index 00000000..cf1e6c3e Binary files /dev/null and b/crates/eframe/data/icon.png differ diff --git a/crates/eframe/src/epi/mod.rs b/crates/eframe/src/epi/mod.rs index 16f026e0..85d5df8c 100644 --- a/crates/eframe/src/epi/mod.rs +++ b/crates/eframe/src/epi/mod.rs @@ -260,10 +260,10 @@ pub struct NativeOptions { /// [drag_and_drop]: https://docs.rs/winit/latest/x86_64-pc-windows-msvc/winit/platform/windows/trait.WindowBuilderExtWindows.html#tymethod.with_drag_and_drop pub drag_and_drop_support: bool, - /// The application icon, e.g. in the Windows task bar etc. + /// The application icon, e.g. in the Windows task bar or the alt-tab menu. /// - /// This doesn't work on Mac and on Wayland. - /// See for more. + /// The default icon is a white `e` on a black background (for "egui" or "eframe"). + /// If you prefer the OS default, set this to `None`. pub icon_data: Option, /// The initial (inner) position of the native window in points (logical pixels). @@ -414,8 +414,12 @@ impl Default for NativeOptions { #[cfg(target_os = "macos")] fullsize_content: false, + // We set a default "egui" or "eframe" icon, which is usually more distinctive than the default OS icon. + icon_data: Some( + IconData::try_from_png_bytes(&include_bytes!("../../data/icon.png")[..]).unwrap(), + ), + drag_and_drop_support: true, - icon_data: None, initial_window_pos: None, initial_window_size: None, min_window_size: None, diff --git a/crates/egui_demo_app/src/main.rs b/crates/egui_demo_app/src/main.rs index 9ab02770..177e24a7 100644 --- a/crates/egui_demo_app/src/main.rs +++ b/crates/egui_demo_app/src/main.rs @@ -22,11 +22,6 @@ fn main() -> Result<(), eframe::Error> { initial_window_size: Some([1280.0, 1024.0].into()), - icon_data: Some( - eframe::IconData::try_from_png_bytes(&include_bytes!("../../../media/icon.png")[..]) - .unwrap(), - ), - #[cfg(feature = "wgpu")] renderer: eframe::Renderer::Wgpu, diff --git a/media/icon.png b/media/icon.png deleted file mode 100644 index ee933460..00000000 Binary files a/media/icon.png and /dev/null differ