mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-27 18:22:41 -08:00
fix(tray): add macOS template tray icon assets
This commit is contained in:
BIN
assets/SubMinerTemplate.png
Normal file
BIN
assets/SubMinerTemplate.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 433 B |
BIN
assets/SubMinerTemplate@2x.png
Normal file
BIN
assets/SubMinerTemplate@2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 580 B |
19
src/main.ts
19
src/main.ts
@@ -2709,12 +2709,21 @@ function createInvisibleWindow(): BrowserWindow {
|
||||
}
|
||||
|
||||
function resolveTrayIconPath(): string | null {
|
||||
const candidates = [
|
||||
path.join(process.resourcesPath, 'assets', 'SubMiner.png'),
|
||||
path.join(app.getAppPath(), 'assets', 'SubMiner.png'),
|
||||
path.join(__dirname, '..', 'assets', 'SubMiner.png'),
|
||||
path.join(__dirname, '..', '..', 'assets', 'SubMiner.png'),
|
||||
const iconNames =
|
||||
process.platform === 'darwin'
|
||||
? ['SubMinerTemplate.png', 'SubMinerTemplate@2x.png', 'SubMiner.png']
|
||||
: ['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) {
|
||||
if (fs.existsSync(candidate)) {
|
||||
return candidate;
|
||||
|
||||
Reference in New Issue
Block a user