Mpv: Title bar color - macOS dark theme

Created on 20 Aug 2017  Â·  13Comments  Â·  Source: mpv-player/mpv

I have a small feature request. I have noticed that other mac software has been implementing custom title bars: it is possible to make it dark to match the dark menu bar and dock.

Examples are editors like Atom and Sublime Text; music players like Spotify; terminals like iTerm; and there's probably more out there.

I say let's have an option for mpv also to make a dark title bar that matches!

Thank you for taking the time to read this.

mac

Most helpful comment

i was thinking about changing the border/title so it is similar to QuickTime, eg within the video frame and automatically fading out and/or make it an option to the --border option. wonder if this is a wanted change/addition. this would also make the no border option a bit more consistent with 'style guidelines', eg a proper shadow and rounded corners.

though it will have some complications especially with the OSC top bar.

All 13 comments

I say use --no-border because who needs a title bar on a video anyway.

--no-border used to make the menu bar unresponsive/broken so I had stopped using it, thanks for reminding me! That's definitely good. I'd be still nice to have a title bar that matches other apps and the macOS dark theme though 😎

Edit: another thought. Sometimes you might have have a substantial number of players active at once whose contents are not easily distinguishable: the title bar provides a means to distinguish them.

i was thinking about changing the border/title so it is similar to QuickTime, eg within the video frame and automatically fading out and/or make it an option to the --border option. wonder if this is a wanted change/addition. this would also make the no border option a bit more consistent with 'style guidelines', eg a proper shadow and rounded corners.

though it will have some complications especially with the OSC top bar.

As a simple solution, NSWindow supports NSAppearanceCustomization, so you can send [window setAppearance: [NSAppearance appearanceNamed:NSAppearanceNameVibrantDark]] and get a window that looks like this:

screen shot 2017-09-12 at 10 11 46

If you also send [window setBackgroundColor:[NSColor blackColor]] you can make the titlebar actually black:

screen shot 2017-09-12 at 10 12 00

This is implemented in the dark-title-bar branch of my fork; I can open a PR if this looks like what you want.

To detect dark mode, you can use [[[NSUserDefaults](https://developer.apple.com/documentation/foundation/nsuserdefaults?language=objc) [standardUserDefaults](https://developer.apple.com/documentation/foundation/nsuserdefaults/1416603-standarduserdefaults?language=objc)] [stringForKey:](https://developer.apple.com/documentation/foundation/nsuserdefaults/1416700-stringforkey?language=objc)@"AppleInterfaceStyle"], which returns @"Dark" iff the user has enabled the dark menu bar/dock. However, Apple recommends that apps always use the dark-on-light color scheme / components (regardless of user preferences) if they are media-centric.

there isn't really a need for such thorough explanation. i at least am well aware of how it works.

i can't really see where Apple recommends what you said, at least not what you linked since that is about HUDs.

i can't really see where Apple recommends what you said, at least not what you linked since that is about HUDs.

HUDs use the dark appearance/material. Combined with the following:

Don’t combine a light appearance with a dark material, or vice versa. You can mix appearances and materials—such as light appearance and medium light material, or dark appearance and ultra dark material—to achieve varying levels of light and dark vibrancy. Just be sure the mixture doesn’t conflict and the resulting effect looks good.

This implies the rest of the user interface probably should too.

that still doesn't say that media centric Apps should use dark appearance, just that dark and light shouldn't be mixed. or do i misunderstand something?

Apple recommends that you use HUDs for media-centric apps:

HUDs are designed to complement apps that focus on highly visual content or that provide an immersive experience, such as a full-screen slide show. For example, QuickTime Player uses a HUD to display inspector information without obstructing too much of the user’s content.

In general, a HUD should only be used in the following scenarios:

  • In a media-oriented app that focuses on movies, photos, or slides.
  • In an immersive app with a dark interface.
  • …

HUDs use a dark appearance. Apple also recommends that you don't mix dark and light appearances. Ergo the rest of the app should probably use a dark interface too.

Also, all of Apple's video-centric apps—QuickTime Player, iMovie, FaceTime—use a dark interface.

we don't use HUDs in mpv or rather there is 'no need' to use HUDs since we only really have a video view. we also don't mix anything, so there is no reason to force a dark theme. if this is changed it should definitely be user changeable in one or another way. i also don't see it as a recommendation but rather as a "should only be used in following cases ... but doesn't need to be used". it's up to the dev what to do.

i would consider Preview (opens slides, Photos, etc) for example also a media oriented App and it uses a light theme with a light HUD-like Panel (Inspector).

It definitely should be user-changeable. The default should probably be dark, though, once it's implemented (especially since the OSC uses a dark theme too).

i would propose/suggest an option with three to five choices (if the variants make a difference)

Sublime supports straight giving it the colors maybe that's what you want too?

just a heads up #5520.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jcowgill picture jcowgill  Â·  3Comments

lightonflux picture lightonflux  Â·  4Comments

SPDurkee picture SPDurkee  Â·  3Comments

thebunnyrules picture thebunnyrules  Â·  3Comments

ww7 picture ww7  Â·  3Comments