Kaynağa Gözat

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

Lucas Fernandes Nogueira 2 yıl önce
ebeveyn
işleme
8ce32e74b5
2 değiştirilmiş dosya ile 11 ekleme ve 1 silme
  1. 5 0
      .changes/default-window-icon.md
  2. 6 1
      core/tauri/src/app.rs

+ 5 - 0
.changes/default-window-icon.md

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

+ 6 - 1
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<()> {