From b77d5386c3717274ff8fa55fc60ba5db16b485fc Mon Sep 17 00:00:00 2001 From: der richter Date: Sun, 24 Mar 2024 02:02:29 +0100 Subject: mac/touchbar: use AppHub directly instead of the singleton --- osdep/mac/touch_bar.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osdep/mac/touch_bar.swift b/osdep/mac/touch_bar.swift index 60ae600c44..811ffcafa4 100644 --- a/osdep/mac/touch_bar.swift +++ b/osdep/mac/touch_bar.swift @@ -71,6 +71,7 @@ extension TouchBar { class TouchBar: NSTouchBar, NSTouchBarDelegate, EventSubscriber { unowned let appHub: AppHub var event: EventHelper? { get { return appHub.event } } + var input: InputHelper { get { return appHub.input } } var configs: [NSTouchBarItem.Identifier:Config] = [:] var isPaused: Bool = false { didSet { updatePlayButton() } } var position: Double = 0 { didSet { updateTouchBarTimeItems() } } @@ -234,12 +235,12 @@ class TouchBar: NSTouchBar, NSTouchBarDelegate, EventSubscriber { @objc func buttonAction(_ button: NSButton) { guard let identifier = getIdentifierFrom(view: button), let command = configs[identifier]?.command else { return } - AppHub.shared.input.command(command) + input.command(command) } @objc func seekbarChanged(_ slider: NSSlider) { guard let identifier = getIdentifierFrom(view: slider), let command = configs[identifier]?.command else { return } - AppHub.shared.input.command(String(format: command, slider.doubleValue)) + input.command(String(format: command, slider.doubleValue)) } func format(time: Int) -> String { -- cgit v1.2.3