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

feat: enable dark mode support by default on macOS #19226

Merged
merged 1 commit into from Jul 15, 2019

Conversation

@MarshallOfSound
Copy link
Member

MarshallOfSound commented Jul 12, 2019

This adds the NSRequiresAquaSystemAppearance key to our default Info.plist file which will tell macOS to auto-switch our effectiveAppearance in sync with the OS. The dark mode documentation has been updated to reflect how to opt out of this but it is also noted that certain dark mode APIs will not work on Catalina if you opt out.

Release Notes

Notes: Native interfaces on macOS (menus, dialogs, etc.) now automatically match the dark mode setting on the users machine.

This adds the NSRequiresAquaSystemAppearance key to our default Info.plist file which will tell macOS to auto-switch our effectiveAppearance in sync with the OS.  The dark mode documentation has been updated to reflect how to opt *out* of this but it is also noted that certain dark mode APIs will not work on Catalina if you opt out.
@miniak
miniak approved these changes Jul 13, 2019
@electron-cation electron-cation bot removed the new-pr 🌱 label Jul 13, 2019
@zcbenz
zcbenz approved these changes Jul 15, 2019
@zcbenz zcbenz merged commit 4d8a055 into master Jul 15, 2019
10 of 11 checks passed
10 of 11 checks passed
build-linux Workflow: build-linux
Details
Artifact Comparison Changes Detected
Details
Semantic Pull Request ready to be squashed
Details
WIP Ready for review
Details
appveyor: win-ia32-testing AppVeyor build succeeded
Details
appveyor: win-ia32-testing-pr AppVeyor build succeeded
Details
appveyor: win-x64-testing AppVeyor build succeeded
Details
appveyor: win-x64-testing-pr AppVeyor build succeeded
Details
build-mac Workflow: build-mac
Details
lint Workflow: lint
Details
release-notes Release notes found
@release-clerk

This comment has been minimized.

Copy link

release-clerk bot commented Jul 15, 2019

Release Notes Persisted

Native interfaces on macOS (menus, dialogs, etc.) now automatically match the dark mode setting on the users machine.

@zcbenz zcbenz deleted the dark-mode-default branch Jul 15, 2019
Copy link
Contributor

caesar left a comment

A couple of incorrect values for NSRequiresAquaSystemAppearance here; see comments.

If you are using [`electron-builder` >= 20.37.0](https://github.com/electron-userland/electron-builder) you can set the [`darkModeSupport`](https://www.electron.build/configuration/mac.html) option.
the UI comes from macOS and not your app. The default behavior as of Electron 7.0.0 is to opt in to this automatic
theming from the OS. If you wish to opt out you must set the `NSRequiresAquaSystemAppearance` key in the `Info.plist` file
to `false`. Please note that once Electron starts building against the 10.14 SDK it will not be possible for you to opt

This comment has been minimized.

Copy link
@caesar

caesar Jul 20, 2019

Contributor

Surely opting out of dark mode will require setting NSRequiresAquaSystemAppearance to true – setting it to false enables dark mode.


If your app does have a dark mode, you can make your Electron app follow the system-wide dark mode setting.
In macOS 10.15 Catalina, Apple introduced a new "automatic" dark mode option for all macOS computers. In order
for the `isDarkMode` and `Tray` APIs to work correctly in this mode on Catalina you need to either have `NSRequiresAquaSystemAppearance` set to `true` in your `Info.plist` file or be on Electron `>=7.0.0`.

This comment has been minimized.

Copy link
@caesar

caesar Jul 20, 2019

Contributor

Here you say that NSRequiresAquaSystemAppearance must be set to true but above (in system-preferences.md) you say it must be set to false.
Setting it to false is correct to enable dark mode; true (default for pre-10.14 SDK) disables it.

caesar added a commit to caesar/electron that referenced this pull request Jul 20, 2019
4d8a055 (electron#19226) introduced incorrect instructions for 'opting out' of dark mode in Electron 7.0.0 and for enabling it on older versions. The boolean values for the `NSRequiresAquaSystemAppearance` key were inverted.
@caesar caesar mentioned this pull request Jul 20, 2019
4 of 4 tasks complete
@caesar

This comment has been minimized.

Copy link
Contributor

caesar commented Jul 20, 2019

Since this PR is already merged I have fixed the above issues in #19358

codebytere added a commit that referenced this pull request Jul 24, 2019
4d8a055 (#19226) introduced incorrect instructions for 'opting out' of dark mode in Electron 7.0.0 and for enabling it on older versions. The boolean values for the `NSRequiresAquaSystemAppearance` key were inverted.
@tyler-ball tyler-ball mentioned this pull request Oct 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.