-
Notifications
You must be signed in to change notification settings - Fork 152
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
feat(windowManager): added app tray, users can minimize, maximize and quit polar from system tray #842
feat(windowManager): added app tray, users can minimize, maximize and quit polar from system tray #842
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #842 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 141 141
Lines 4609 4609
Branches 861 861
=========================================
Hits 4609 4609 ☔ View full report in Codecov by Sentry. |
Hey @AdamuAbba, thanks so much for the PR. I tested it locally and it works great. I have some feedback but it's pretty much all cosmetic:
Let me know if you need assistance with creating the logo image or icons and I'll try to help create them. |
Hey @jamaljsr thank you so much for the review. yes I would need help with creating the logo images or icons i'd really appreciate that thanks. let me know when it's done and I'll hop on integrating them ASAP |
Ok, I'll take a look into this over the weekend. |
Alright, thanks |
Hey @jamaljsr so I went and got some icons and was able to get the light and dark theme icon switch working on macOS but I've struggled with getting it to work on Windows and Ubuntu. for some reason, the context menu doesn't refresh to reflect the updates once you've switched between dark theme and light theme on your computer. I'm a bit frustrated as to why this is not working tho I've been trying to get it to work since the day you dropped your most recent comment. |
Hi @AdamuAbba, that sounds like good progress. Can you push your code so I can give it a try. I'll be able to try it out tomorrow. |
79a7c05
to
172a0ba
Compare
Hey @jamaljsr sorry it's been a long couple of hours on my end I had to reach out for some help and was eventually able to get the icons to swap out on both light and dark theme through the help of @NonsoAmadi10 a fellow and more experienced polar contributor. I also went ahead to squash some commits together not sure it was exactly how I planned it to be but gladly the updates are in the most recent commit and in the PR. is everything working fine on your end? |
Thank you for figuring out how to get this working. It's looking very good now on Mac. I'll do some more testing on Linux and windows by tomorrow. |
Hey @jamaljsr thanks for the review, really appreciate it. to answer your question:
onMainClosed() {
this.mainWindow = null;
}
onAllClosed() {
if (process.platform !== 'darwin') {
app.quit();
}
} so I've gone ahead to refactor a bit onMainClosed() {
this.mainWindow = null;
this.tray?.destroy();
app.quit();
}
onAllClosed() {
this.tray?.destroy();
app.quit();
} This ensures that the tray is destroyed and the app is killed when the main window is closed which is the expected behavior on macOS. my recent commit implements this. |
Thanks, for pointing me to the docs on the image. I tested this on Mac and Linux. My Windows machine is giving me problems but I'll hopefully get that working soon. This looks pretty much good to go. Can you rebase this branch on master for one final round of testing? |
oh goodness, I'll get on it and push an update. thank you |
af67e69
to
2e325ba
Compare
hey @jamaljsr sorry it took a while, been a crazy couple of weeks. Amazing polar maintainer session at BTrust the other day, I learned a lot from your time with us.
let me know if I missed anything and I'll get on it thank you. |
No worries on the timing. Thanks for fixing this remaining issue. I'll test again on Windows as soon as I have a chance. |
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.
Apologies for the delay in review. I've been traveling a bunch this month and didn't have my windows machine with me.
I noticed a couple of remaining issues.
Hey @jamaljsr been a while, glad you're back. so for the first issue with the icons not showing the proper size on a native Windows 10 machine I might need more details to reproduce it on my end because the icons do show up fine on my native Windows 10 machine. the screenshots I shared were actually from thesame machine 🤔 As for the second issue I'll get to work on fixing that as well. Thanks for the review. |
Oh my bad, I tried again on my Windows 10 machine and I realized I didn't pull the latest branch the last time I tested. I can confirm that the icons are the correct size now. |
alright perfect @jamaljsr I'll focus on fixing the second issue and update the PR |
0cdf731
to
7298360
Compare
2e77a60
to
50dc1ea
Compare
@AdamuAbba Thank you for getting this 99% there. I want to get this merged before the next release. I did a bunch of testing on all 3 platforms. I made a few tweaks to get it working on Windows and refactored the code a bit. |
Hey @jamaljsr thank you so much, sorry i was away for a bit as well hence my inactivity. I'm glad to have been of help |
Closes #693
Description
This PR contains changes to specifically the
electron/windowManager.ts
file which addresses issue #693 requesting a feature that enables the user to minimize the app to the system tray. my implementation so far leverages theTray
class from theelectron
package and enables the user to hide theBrowserWindow
object while keeping the app alive in the background.Steps to Test
1 To test on Ubuntu, Windows, and macOS machines, run the app in dev mode
2 Click on the Tray icon on the top right-hand corner of the operating system's panel
3 Click on any option from the context menu to either hide, show, or Quit the Polar app.
Screenshots
Ubuntu

macOS
