1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-30 13:20:05 -04:00

Set a default icon for all eframe apps: a white e on black background (#2996)

As a user you can change this by setting `NativeOptions::icon_data`.
Set it to `None` to get the default icon assigned by the OS.
This commit is contained in:
Emil Ernerfeldt
2023-05-17 16:23:32 +02:00
committed by GitHub
parent 856afc8f7e
commit 7b76161a6a
5 changed files with 15 additions and 10 deletions

View File

@@ -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 <https://docs.rs/winit/latest/winit/window/struct.Window.html#method.set_window_icon> 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<IconData>,
/// 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,