Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

macOS Dark Mode and NSAboutPanelOptionCredits

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

like image 943
Drew Avatar asked Dec 07 '18 14:12

Drew


3 Answers

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.

like image 143
James Bucanek Avatar answered Nov 03 '22 01:11

James Bucanek


for whom needs it.. enter image description here

when opens:

enter image description here

like image 22
ingconti Avatar answered Nov 03 '22 01:11

ingconti


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.

like image 43
Brendan Shanks Avatar answered Nov 03 '22 00:11

Brendan Shanks