Closed yaelsch closed 4 years ago
What's the change dictionary?
But yeah IIRC you need to restart the plugin for the theme to be picked up (there isn't a listener).
It seems that there is a change listener:
NSApplication.sharedApplication().addObserver_forKeyPath_options_context(
themeObserver,
'effectiveAppearance',
NSKeyValueChangeNewKey,
null
)
And you can see the values are changing without restart, only to the opposite value.
Regarding the change dictionary, if I understand the signature of observeValueForKeyPath:ofObject:change:context
the "change" parameter is supposed to hold the values of property that changed (see: https://developer.apple.com/documentation/objectivec/nsobject/1416553-observevalueforkeypath)
Oh right. Well if you want to have a go at it, I'd be happy to review a PR!
Hi! It seems that when switching between themes the value is set to the previous theme value instead of the new value.
I looked into this code and I'm might be totally off here, but is it possible that the value should be read from the
change
dictionary instead ofMSTheme.sharedTheme()
?