From 1f8fee03fdc5c10ec4585aab7dedb16dbff0f010 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sun, 1 Jun 2025 09:42:54 +0200 Subject: [PATCH] auto-git: [change] modules/tray.js --- modules/tray.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/modules/tray.js b/modules/tray.js index e69de29..0772547 100644 --- a/modules/tray.js +++ b/modules/tray.js @@ -0,0 +1,28 @@ +function createTray(win) { + const iconPath = path.join(__dirname, 'assets/icon/trayicon.png'); + const icon = nativeImage.createFromPath(iconPath); + + // Standard-Größen je nach OS + let size; + switch (process.platform) { + case 'darwin': // macOS + size = { width: 22, height: 22 }; + break; + case 'win32': // Windows + size = { width: 16, height: 16 }; + break; + default: // Linux / other + size = { width: 24, height: 24 }; + } + + const trayImage = icon.resize(size); + const tray = new Tray(trayImage); + + tray.setToolTip('Auto-Git läuft im Hintergrund'); + tray.on('double-click', () => { + win.show(); + win.focus(); + }); + + return tray; +} \ No newline at end of file