-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable tray icon on Linux without breaking Windows #23
Conversation
@@ -24,14 +24,22 @@ const {app, BrowserWindow, Menu, Tray} = require('electron'); | |||
const path = require('path'); | |||
const config = require('./../config'); | |||
|
|||
const iconPath = path.join(app.getAppPath(), 'img', 'tray.ico'); | |||
const iconBadgePath = path.join(app.getAppPath(), 'img', 'tray.badge.ico'); | |||
var iconExt = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var iconExt = 'png';
You should also update this part: https://github.com/wireapp/wire-desktop/blob/master/electron/js/util.js#L59-L69 to something like: if (process.platform === 'darwin') {
app.dock.setBadge(count ? count[1] : '');
} else if (count) {
tray.useBadgeIcon();
} else {
tray.useDefaultIcon();
} |
Having done all that.. it doesn't work on my Ubuntu 16.04 :/ Can you send us a screenshot wiht yours? |
I'm out of town / away from my laptop today. I'll send a screenshot over as soon as I can. |
🌴 🍺 🍸 |
Your next task is to make the travis tests green.. and we'll ask our designers to provide the correct PNGs :) |
Getting a type error now. A little over my head. Any suggestions? Also, if you want to ask your designers for an SVG app icon to go with the PNG tray icons, that'd be great! 😃 |
Played around a little, but still no luck. I tried replacing line 33 (
Might it be related to: electron/electron#1006 |
It looks like |
As far as I can tell, the app icon is originally set to null but should be replaced as long as we're not on Darwin. Not sure why it isn't getting replaced later on. I'm not familiar with JS, so I might be reading it wrong. |
Could it be that the test is simply timing out before the badge updates? On my machine, when I run
I have tried to adjust the timeout with |
Can you add please these images for now and we'll deal with the exact resolutions later on.. |
Done! 😄 |
As for the tests it's failing because the useDefaultIcon: function() {
if (appIcon == null) return;
appIcon.setImage(iconPath);
},
useBadgeIcon: function() {
if (appIcon == null) return;
appIcon.setImage(iconBadgePath);
} |
Also.. did you sign our CLA? |
Let's see if Travis is going to wake up today! :) Can you post screenshots of the two icons from your machine? |
Strange, Travis just passed on the commit before the Travis fixes you suggested! I'll get the screenshots and CLA to you as soon as I'm back in my office after a meeting.
|
CLA approved |
Boom.. |
Here is a suggestion to resolve issue #22, and offer a more elegant solution to issue #1. The png icons are of my own making, having traced the ico files in inkscape. They can and maybe should be replaced by official icons, but they do the trick for now!