fix: Tray-Icon API kompatibel (kein Image::from_bytes)
Nutzt default_window_icon() statt Image::from_bytes das in dieser Tauri-Version nicht existiert. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ac5a0a3367
commit
c354682905
|
|
@ -555,9 +555,8 @@ pub fn run() {
|
||||||
let sync_now = MenuItem::with_id(app, "sync", "Jetzt synchronisieren", true, None::<&str>)?;
|
let sync_now = MenuItem::with_id(app, "sync", "Jetzt synchronisieren", true, None::<&str>)?;
|
||||||
let menu = Menu::with_items(app, &[&show, &sync_now, &quit])?;
|
let menu = Menu::with_items(app, &[&show, &sync_now, &quit])?;
|
||||||
|
|
||||||
// Use bundled icon for tray
|
// Use window icon for tray (set via tauri.conf.json)
|
||||||
let icon = app.default_window_icon().cloned()
|
let icon = app.default_window_icon().cloned();
|
||||||
.unwrap_or_else(|| tauri::image::Image::from_bytes(include_bytes!("../icons/32x32.png")).unwrap());
|
|
||||||
|
|
||||||
// Handle .cloud file opened via file association (double-click)
|
// Handle .cloud file opened via file association (double-click)
|
||||||
let args: Vec<String> = std::env::args().collect();
|
let args: Vec<String> = std::env::args().collect();
|
||||||
|
|
@ -574,8 +573,9 @@ pub fn run() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TrayIconBuilder::new()
|
let mut tray = TrayIconBuilder::new();
|
||||||
.icon(icon)
|
if let Some(ic) = icon { tray = tray.icon(ic); }
|
||||||
|
tray
|
||||||
.tooltip("Mini-Cloud Sync")
|
.tooltip("Mini-Cloud Sync")
|
||||||
.menu(&menu)
|
.menu(&menu)
|
||||||
.on_menu_event(|app, event| {
|
.on_menu_event(|app, event| {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue