Skip to content

Commit 0f68949

Browse files
authored
[Other] Update icons with better quality ones (#2096)
* other: updated tray icons and added OS logic * chore: log
1 parent e864e30 commit 0f68949

8 files changed

+24
-4
lines changed

public/icon-dark.png

535 Bytes
Loading

public/[email protected]

1.94 KB
Loading

public/[email protected]

2.94 KB
Loading

public/icon-light.png

552 Bytes
Loading

public/[email protected]

2.06 KB
Loading

public/[email protected]

3.11 KB
Loading

src/backend/main.ts

+24-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ import {
1818
powerSaveBlocker,
1919
protocol,
2020
screen,
21-
clipboard
21+
clipboard,
22+
nativeImage
2223
} from 'electron'
2324
import 'backend/updater'
2425
import { autoUpdater } from 'electron-updater'
@@ -476,7 +477,25 @@ if (!gotTheLock) {
476477
mainWindow.webContents.setZoomFactor(processZoomForScreen(zoomFactor))
477478
}, 200)
478479

479-
const trayIcon = darkTrayIcon ? iconDark : iconLight
480+
const iconSizesByPlatform = {
481+
darwin: {
482+
width: 20,
483+
height: 20
484+
},
485+
linux: {
486+
width: 32,
487+
height: 32
488+
},
489+
win32: {
490+
width: 32,
491+
height: 32
492+
}
493+
}
494+
495+
const trayIcon = nativeImage
496+
.createFromPath(darkTrayIcon ? iconDark : iconLight)
497+
.resize(iconSizesByPlatform[process.platform])
498+
480499
const appIcon = new Tray(trayIcon)
481500

482501
appIcon.on('double-click', () => {
@@ -498,7 +517,9 @@ if (!gotTheLock) {
498517
logInfo('Changing Tray icon Color...', { prefix: LogPrefix.Backend })
499518
setTimeout(async () => {
500519
const { darkTrayIcon } = await GlobalConfig.get().getSettings()
501-
const trayIcon = darkTrayIcon ? iconDark : iconLight
520+
const trayIcon = nativeImage
521+
.createFromPath(darkTrayIcon ? iconDark : iconLight)
522+
.resize(iconSizesByPlatform[process.platform])
502523
appIcon.setImage(trayIcon)
503524
appIcon.setContextMenu(await contextMenu())
504525
}, 500)

src/backend/utils.ts

-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,6 @@ export const getSystemInfo = async () => {
288288
// get OS information
289289
const { distro, kernel, arch, platform, release, codename } =
290290
await si.osInfo()
291-
console.log({ release, codename })
292291

293292
// get GPU information
294293
const { controllers } = await si.graphics()

0 commit comments

Comments
 (0)