From 8ce32e74b5573931c3bc81e8e893a6d3b9686b0e Mon Sep 17 00:00:00 2001 From: Lucas Fernandes Nogueira Date: Wed, 17 May 2023 19:54:15 -0300 Subject: [PATCH] feat(core): expose default_window_icon on App and AppHandle (#6986) --- .changes/default-window-icon.md | 5 +++++ core/tauri/src/app.rs | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 .changes/default-window-icon.md diff --git a/.changes/default-window-icon.md b/.changes/default-window-icon.md new file mode 100644 index 00000000000..e90fb02e37a --- /dev/null +++ b/.changes/default-window-icon.md @@ -0,0 +1,5 @@ +--- +"tauri": patch +--- + +Add `default_window_icon` getter on `App` and `AppHandle`. diff --git a/core/tauri/src/app.rs b/core/tauri/src/app.rs index f5b7b3d360d..2cc10f3e2b4 100644 --- a/core/tauri/src/app.rs +++ b/core/tauri/src/app.rs @@ -23,7 +23,7 @@ use crate::{ sealed::{ManagerBase, RuntimeOrDispatch}, utils::config::Config, utils::{assets::Assets, Env}, - Context, DeviceEventFilter, EventLoopMessage, Invoke, InvokeError, InvokeResponse, Manager, + Context, DeviceEventFilter, EventLoopMessage, Icon, Invoke, InvokeError, InvokeResponse, Manager, Runtime, Scopes, StateManager, Theme, Window, }; @@ -570,6 +570,11 @@ macro_rules! shared_app_impl { } } + /// Returns the default window icon. + pub fn default_window_icon(&self) -> Option<&Icon> { + self.manager.inner.default_window_icon.as_ref() + } + /// Shows the application, but does not automatically focus it. #[cfg(target_os = "macos")] pub fn show(&self) -> crate::Result<()> {