Skip to content

Commit 6f251a1

Browse files
Add a tray icon
1 parent 6052502 commit 6f251a1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

assets/home-icon.png

866 Bytes
Loading

src/app/index.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,12 @@ export class App {
273273

274274
require('./menu');
275275

276-
this.tray = new Tray(electron.nativeImage.createEmpty());
277-
this.tray.setTitle('Home');
276+
const icon = electron.nativeImage
277+
.createFromPath(path.resolve(__dirname, '..', '..', 'assets', 'home-icon.png'))
278+
.resize({height: 22});
279+
icon.setTemplateImage(true);
280+
281+
this.tray = new Tray(icon);
278282

279283
this.menu = Menu.buildFromTemplate([
280284
{label: 'Show', click: () => app.showWindow()},

0 commit comments

Comments
 (0)