Skip to content
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

event 'platform-theme-changed' removed?!!! #5623

Closed
MathijsvVelde opened this issue May 20, 2016 · 3 comments
Closed

event 'platform-theme-changed' removed?!!! #5623

MathijsvVelde opened this issue May 20, 2016 · 3 comments

Comments

@MathijsvVelde
Copy link

  • Electron version: v0.37.8+
  • Operating system: *

The tray icon in my app changes color depending on the current theme of the menu bar (OSX)
So I was depending on the event platform-theme-changed in electron.app
If it was just moved, I did not mind, but it is removed, in this PR to be precise (#5282). 😢

Can you please put back again, as it must in electron.SystemPreferences?

Thanks!

@danhp
Copy link
Contributor

danhp commented May 20, 2016

It was replaced by the much more powerful subscribeNotification which can achieve the same effect.
If you feel lazy you can use https://github.com/danhp/electron-osx-appearance instead of looking things up.

@MathijsvVelde
Copy link
Author

Okay,
Thanks for the quick reply.
It seems that I missed the deprecated warning.

Thanks 👍

@rootscript
Copy link

@danhp @MathijsvVelde - I was trying to use as:

const {systemPreferences} = require('electron')
app.on('platform-theme-changed', function () {
    console.log(`Platform theme changed. In dark mode? ${systemPreferences.isDarkMode()}`)
})

do you have an example with subscribeNotification, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants