How to make a menu-style app nice with Dark Mode in Yosemite?

When developing a menu-menu, it’s hard for me to find a preferred method for the application to look good. I would have thought that Apple controls would essentially handle this for the most part, but it is not.

What is the preferred method to make the menu app look good in both light and dark mode? Am I missing some control features that make this easier, or do I need to manually define the mode and change the controls accordingly?

+6
source share
2 answers

I have a menu for the menu , and I did not have to do anything to make it look good in a dark theme.

Easy theme:

Light theme

Dark Theme:

Dark theme

The most important things you need to do are:

  • Use system colors (for example, [NSColor textColor] , [NSColor textBackgroundColor] ) that automatically adapt to different themes. See Color and typography of the Apple OS X Human Interface Guide.

  • Use image templates. They also adapt to color changes. See the “Secured by Image System” section of the Apple OS X Human Interface Guide.

It is worth noting that Apple did not make it easy to programmatically determine which color theme works (there are some tricks, but I do not know any authorized method). I mean, they did it on purpose, so the developers do not execute custom materials for each topic. You do not need to use system colors and pattern images.

Update: Sample project here: https://github.com/zpasternack/MenuBarTest

+7
source

Well, you do not explain (or show) how this looks bad. Perhaps you are using a regular, non-template image for your icon. You must use a template image, which is an image whose only significant part is the alpha mask. You tell the system that this is an image of a template, either by calling it the suffix "Template" (for example, "FooTemplate.png") or calling -setTemplate: on it.

+3
source

Source: https://habr.com/ru/post/989301/


All Articles