use tauri::image::Image;
use tauri::{AppHandle, Manager, Runtime};
use crate::hub::ENGINE_LABEL;
pub(super) fn apply<R: Runtime>(app: &AppHandle<R>, count: Option<u64>, only: Option<&str>) {
let icon = count.map(|c| Image::new_owned(super::icon::render(c), super::icon::SIZE, super::icon::SIZE));
for (label, window) in app.webview_windows() {
if label == ENGINE_LABEL || only.is_some_and(|l| l != label) {
continue;
}
if let Err(err) = window.set_overlay_icon(icon.clone()) {
log::debug!("窗口 {label} 的叠加图标设置失败:{err}");
}
}
}