macOS Dark Mode and NSAboutPanelOptionCredits
Asked Answered
S

3

9

I have a fairly straight forward App called Range in the app store that I want to make dark mode compliant for macOS 10.14. I've noticed is that the About window is not changing all of the text colors.

I'm using the NSAboutPanelOptionCredits where I just need to bundle a Credits.rtf file and the app handles the rest.

https://developer.apple.com/documentation/appkit/nsaboutpaneloptioncredits?language=objc

Problem is, when I change to dark mode, the text in the file remains black, while the other auto-included text changes to white (app name, version etc...) I've opened up the .rtf file and there is no Inherit setting, or anything of the sort.

Any idea what I'm doing wrong, and/or missing?

Appreciate any thoughts. Thanks!

Light about window Dark about window

Sapowith answered 7/12, 2018 at 14:17 Comment(0)
D
10

The trick is to use semantic colors.

Using Xcode, edit your RTF file. Select the text and bring up the text color picker.

Xcode adds the Developer colors to the color picker. Select the appropriate semantic color for your text; I tend to use labelColor, secondaryLabelColor, and linkColor.

When you switch to dark mode, these semantic colors change appropriately.

Draughtboard answered 8/12, 2018 at 4:36 Comment(0)
G
3

for whom needs it.. enter image description here

when opens:

enter image description here

Genitor answered 22/5, 2019 at 8:32 Comment(0)
E
2

The 10.14 AppKit Release Notes may be helpful:

Appearance-Aware Credits

You make the credits area match the appearance of an app by supplying the credits as an attributed string or by placing a Credits.rtf or Credits.rtfd in your app's bundle. Use the proper system colors, like textColor, linkColor, and labelColor, to make text display correctly in any appearance. If you use .rtf or .rtfd files to supply text for the credits area, the file must be saved using macOS 10.14 (beta 5 or later) to receive the appearance-aware treatment. If you create the file .rtf or .rtfd files on an earlier version of macOS, the appearance-aware treatment is only applied if the file contains only black text with no background color.

Electrothermal answered 11/12, 2018 at 0:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.