Skip to content

Commit

Permalink
fix: alternate idle images for linux
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Setch <adam.setch@outlook.com>
  • Loading branch information
setchy committed Sep 1, 2024
1 parent e11b877 commit 6336484
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 3 deletions.
Binary file added assets/images/tray-idle-white-update.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/tray-idle-white-update@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/tray-idle-white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/tray-idle-white@2x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/tray-idleTemplate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 17 additions & 3 deletions src/electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ log.initialize();
const idleIcon = path.resolve(
`${__dirname}/../../assets/images/tray-idleTemplate.png`,
);
const idleAlternateIcon = path.resolve(
`${__dirname}/../../assets/images/tray-idle-white.png`,
);
const idleUpdateAvailableIcon = path.resolve(
`${__dirname}/../../assets/images/tray-idle-update.png`,
);
const idleAlternateUpdateAvailableIcon = path.resolve(
`${__dirname}/../../assets/images/tray-idle-white-update.png`,
);
const activeIcon = path.resolve(
`${__dirname}/../../assets/images/tray-active.png`,
);
Expand Down Expand Up @@ -189,9 +195,17 @@ app.whenReady().then(async () => {

ipc.on('gitify:icon-idle', () => {
if (!mb.tray.isDestroyed()) {
mb.tray.setImage(
updateAvailableMenuItem.visible ? idleUpdateAvailableIcon : idleIcon,
);
if (process.platform === 'darwin' || process.platform === 'win32') {
mb.tray.setImage(
updateAvailableMenuItem.visible ? idleUpdateAvailableIcon : idleIcon,
);
} else {
mb.tray.setImage(
updateAvailableMenuItem.visible
? idleAlternateUpdateAvailableIcon
: idleAlternateIcon,
);
}
}
});

Expand Down

0 comments on commit 6336484

Please sign in to comment.