Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a menubar app look good with "Dark Mode" in Yosemite?

While developing a menubar app, I am having a hard time finding the preferred method for making the app actually look good. I would have thought that Apple controls would have essentially handled this for the most part, but it appears not.

What is the preferred method for making sure a menubar app looks good in both light and dark mode? Am I missing some control functionality that facilitates this more easily or do I need to manually detect the mode and modify controls appropriately?

like image 634
ylluminate Avatar asked Jun 17 '15 19:06

ylluminate


People also ask

How do I make the Apple menu bar darker?

You can use a light or dark appearance for the menu bar, Dock, windows, and built-in apps on your Mac, or automatically adjust the appearance from light to dark during the day. On your Mac, choose Apple menu > System Preferences, then click General . Select Light, Dark, or Auto.

How do you customize the menu bar on a Mac?

On your Mac, use Dock & Menu Bar System Preferences to change the appearance of the Dock, and to select items to show in the menu bar and in Control Center. To change these preferences, choose Apple menu > System Preferences, then click Dock & Menu Bar .

How do you use only a dark menu bar and Dock in macOS Mojave?

Log right back in to the same user account. Click the Apple menu and go back to System Preferences > General. Under the Appearance section, select Dark. This will turn only the menu bar and Dock into dark mode.


2 Answers

I have a menubar app, and I didn't have to do anything to make it look good in the dark theme.

Light theme:

Light theme

Dark theme:

Dark theme

The most important things you need to do are:

  1. Use system colors (e.g., [NSColor textColor], [NSColor textBackgroundColor]. These automatically adapt with the various themes. See the Color and Typography section of Apple's OS X Human Interface Guidelines.

  2. Use template images. These also adapt to color changes. See the System-Provided Images section of Apple's OS X Human Interface Guidelines.

It's worth noting that Apple has not made it easy to programmatically detect which color theme is running (there are some tricks, but I'm not aware of any sanctioned method). My sense is that they've done this intentionally, so developers don't do custom per-theme stuff. Using system colors and template images, you shouldn't have to.

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

like image 195
zpasternack Avatar answered Oct 03 '22 11:10

zpasternack


Well, you haven't explain (or shown) in what way it looks bad. Probably, you are using a normal, non-template image for its icon. You should use a template image, which is an image whose only significant part is the alpha mask. You tell the system that it's a template image either by naming it with a "Template" suffix (e.g. "FooTemplate.png") or by calling -setTemplate: on it.

like image 42
Ken Thomases Avatar answered Oct 03 '22 11:10

Ken Thomases