feat(core): expose default_window_icon on App and AppHandle (#6986)

This commit is contained in:
Lucas Fernandes Nogueira 2023-05-17 19:54:15 -03:00 committed by GitHub
parent 2344aea176
commit 8ce32e74b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"tauri": patch
---
Add `default_window_icon` getter on `App` and `AppHandle`.

View File

@ -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<()> {