mac/touchbar: move touch bar into AppHub

This commit is contained in:
der richter 2024-03-24 00:34:04 +01:00
parent 3e6c931d90
commit f9618ea487
2 changed files with 7 additions and 1 deletions

View File

@ -24,6 +24,9 @@ class AppHub: NSObject {
#if HAVE_MACOS_MEDIA_PLAYER
var remote: RemoteCommandCenter?
#endif
#if HAVE_MACOS_TOUCHBAR
@objc var touchBar: TouchBar?
#endif
var isApplication: Bool { get { NSApp is Application } }
@ -44,6 +47,9 @@ class AppHub: NSObject {
event = EventHelper(mpv)
#if HAVE_MACOS_MEDIA_PLAYER
remote?.registerEvents()
#endif
#if HAVE_MACOS_TOUCHBAR
touchBar = TouchBar()
#endif
}

View File

@ -157,7 +157,7 @@ static const char mac_icon[] =
#if HAVE_MACOS_TOUCHBAR
- (NSTouchBar *)makeTouchBar
{
return [[TouchBar alloc] init];
return [[AppHub shared] touchBar];
}
#endif