From df5e562ea6d52cc2fa64dc21ae74c6c4b7163887 Mon Sep 17 00:00:00 2001 From: Michael SCHAL Date: Tue, 26 May 2026 20:07:54 +0200 Subject: [PATCH] Fix winreg predef and tauri systemTray config to enable system-tray Cargo feature --- widget/src-tauri/src/main.rs | 4 ++-- widget/src-tauri/tauri.conf.json | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/widget/src-tauri/src/main.rs b/widget/src-tauri/src/main.rs index 4e6566c..88b9a1c 100644 --- a/widget/src-tauri/src/main.rs +++ b/widget/src-tauri/src/main.rs @@ -28,7 +28,7 @@ fn set_autostart(enabled: bool) -> Result<(), String> { // Permet d'activer ou de désactiver le lancement automatique au démarrage de Windows. // On écrit directement dans le registre Windows (HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run) // ce qui évite d'avoir à gérer un installateur complexe ou des plugins externes lourds. - let hkcu = RegKey::predefined(HKEY_CURRENT_USER); + let hkcu = RegKey::predef(HKEY_CURRENT_USER); let run_key = hkcu .open_subkey_with_flags( r"Software\Microsoft\Windows\CurrentVersion\Run", @@ -55,7 +55,7 @@ fn set_autostart(enabled: bool) -> Result<(), String> { #[tauri::command] fn get_autostart() -> Result { // Lit le registre Windows pour vérifier si l'application est configurée pour démarrer automatiquement. - let hkcu = RegKey::predefined(HKEY_CURRENT_USER); + let hkcu = RegKey::predef(HKEY_CURRENT_USER); let run_key = hkcu .open_subkey_with_flags( r"Software\Microsoft\Windows\CurrentVersion\Run", diff --git a/widget/src-tauri/tauri.conf.json b/widget/src-tauri/tauri.conf.json index 174697a..d224e07 100644 --- a/widget/src-tauri/tauri.conf.json +++ b/widget/src-tauri/tauri.conf.json @@ -48,6 +48,11 @@ "security": { "csp": null }, + "systemTray": { + "iconPath": "icons/icon.ico", + "iconAsTemplate": false, + "menuOnLeftClick": false + }, "windows": [ { "fullscreen": false,