fix(tray): add macOS template tray icon assets

This commit is contained in:
2026-02-19 00:02:51 -08:00
parent e73a380f38
commit 2c2f342854
3 changed files with 14 additions and 5 deletions

BIN
assets/SubMinerTemplate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

View File

@@ -2709,12 +2709,21 @@ function createInvisibleWindow(): BrowserWindow {
} }
function resolveTrayIconPath(): string | null { function resolveTrayIconPath(): string | null {
const candidates = [ const iconNames =
path.join(process.resourcesPath, 'assets', 'SubMiner.png'), process.platform === 'darwin'
path.join(app.getAppPath(), 'assets', 'SubMiner.png'), ? ['SubMinerTemplate.png', 'SubMinerTemplate@2x.png', 'SubMiner.png']
path.join(__dirname, '..', 'assets', 'SubMiner.png'), : ['SubMiner.png'];
path.join(__dirname, '..', '..', 'assets', 'SubMiner.png'),
const baseDirs = [
path.join(process.resourcesPath, 'assets'),
path.join(app.getAppPath(), 'assets'),
path.join(__dirname, '..', 'assets'),
path.join(__dirname, '..', '..', 'assets'),
]; ];
const candidates = baseDirs.flatMap((baseDir) =>
iconNames.map((iconName) => path.join(baseDir, iconName)),
);
for (const candidate of candidates) { for (const candidate of candidates) {
if (fs.existsSync(candidate)) { if (fs.existsSync(candidate)) {
return candidate; return candidate;