From e77d9ff3b9f8a4410832a0855410b8939447540e Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Fri, 11 Dec 2020 11:00:53 -0800 Subject: [PATCH] docs: add missing deprecated systemPreferences APIs to breaking-changes (#26937) Co-authored-by: Milan Burda --- docs/breaking-changes.md | 46 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/docs/breaking-changes.md b/docs/breaking-changes.md index 7b67e9ed06414..cd09307cf4db9 100644 --- a/docs/breaking-changes.md +++ b/docs/breaking-changes.md @@ -448,6 +448,52 @@ in Electron 8.x, and cease to exist in Electron 9.x. The layout zoom level limits are now fixed at a minimum of 0.25 and a maximum of 5.0, as defined [here](https://chromium.googlesource.com/chromium/src/+/938b37a6d2886bf8335fc7db792f1eb46c65b2ae/third_party/blink/common/page/page_zoom.cc#11). +### Deprecated events in `systemPreferences` + +The following `systemPreferences` events have been deprecated: +* `inverted-color-scheme-changed` +* `high-contrast-color-scheme-changed` + +Use the new `updated` event on the `nativeTheme` module instead. + +```js +// Deprecated +systemPreferences.on('inverted-color-scheme-changed', () => { /* ... */ }) +systemPreferences.on('high-contrast-color-scheme-changed', () => { /* ... */ }) + +// Replace with +nativeTheme.on('updated', () => { /* ... */ }) +``` + +### Deprecated: methods in `systemPreferences` + +The following `systemPreferences` methods have been deprecated: +* `systemPreferences.isDarkMode()` +* `systemPreferences.isInvertedColorScheme()` +* `systemPreferences.isHighContrastColorScheme()` + +Use the following `nativeTheme` properties instead: +* `nativeTheme.shouldUseDarkColors` +* `nativeTheme.shouldUseInvertedColorScheme` +* `nativeTheme.shouldUseHighContrastColors` + +```js +// Deprecated +systemPreferences.isDarkMode() +// Replace with +nativeTheme.shouldUseDarkColors + +// Deprecated +systemPreferences.isInvertedColorScheme() +// Replace with +nativeTheme.shouldUseInvertedColorScheme + +// Deprecated +systemPreferences.isHighContrastColorScheme() +// Replace with +nativeTheme.shouldUseHighContrastColors +``` + ## Planned Breaking API Changes (7.0) ### Deprecated: Atom.io Node Headers URL