1
0
mirror of https://github.com/Toxblh/MTMR.git synced 2026-01-10 17:08:39 +00:00

fix broken close/open and toggle control strip

This commit is contained in:
Serg 2018-05-26 13:09:24 +07:00
parent 088f141da3
commit 56d64155ae

View File

@ -90,7 +90,10 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
SupportedTypesHolder.sharedInstance.register(typename: "exitTouchbar", item: .staticButton(title: "exit"), action: .custom(closure: { [weak self] in self?.dismissTouchBar()}), longAction: .none)
SupportedTypesHolder.sharedInstance.register(typename: "close") { _ in
return (item: .staticButton(title: ""), action: .custom(closure: { [weak self] in self?.touchbarNeedRefresh = true; self?.createAndUpdatePreset() }), longAction: .none, parameters: [.width: .width(30), .image: .image(source: (NSImage(named: .stopProgressFreestandingTemplate))!)])
return (item: .staticButton(title: ""), action: .custom(closure: { [weak self] in
self?.touchbarNeedRefresh = true
self?.createAndUpdatePreset()
}), longAction: .none, parameters: [.width: .width(30), .image: .image(source: (NSImage(named: .stopProgressFreestandingTemplate))!)])
}
if let blackListed = UserDefaults.standard.stringArray(forKey: "com.toxblh.mtmr.blackListedApps") {
@ -216,11 +219,12 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
}
@objc func resetControlStrip() {
NSTouchBar.minimizeSystemModalFunctionBar(self.touchBar)
dismissTouchBar()
presentTouchBar()
}
@objc private func dismissTouchBar() {
self.touchbarNeedRefresh = true
NSTouchBar.minimizeSystemModalFunctionBar(touchBar)
}