diff --git a/MTMR/ItemsParsing.swift b/MTMR/ItemsParsing.swift index c8f0f2c..d221685 100644 --- a/MTMR/ItemsParsing.swift +++ b/MTMR/ItemsParsing.swift @@ -48,20 +48,6 @@ class SupportedTypesHolder { "delete": { _ in return (item: .staticButton(title: "del"), action: .keyPress(keycode: 117), longAction: .none, parameters: [:])}, - "brightnessUp": { _ in - let imageParameter = GeneralParameter.image(source: #imageLiteral(resourceName: "brightnessUp")) - return (item: .staticButton(title: ""), action: .custom(closure: { - sharedBrightnessController.increase() - }), longAction: .none, parameters: [.image: imageParameter]) - }, - - "brightnessDown": { _ in - let imageParameter = GeneralParameter.image(source: #imageLiteral(resourceName: "brightnessDown")) - return (item: .staticButton(title: ""), action: .custom(closure: { - sharedBrightnessController.decrease() - }), longAction: .none, parameters: [.image: imageParameter]) - }, - "illuminationUp": { _ in let imageParameter = GeneralParameter.image(source: #imageLiteral(resourceName: "ill_up")) return (item: .staticButton(title: ""), action: .hidKey(keycode: NX_KEYTYPE_ILLUMINATION_UP), longAction: .none, parameters: [.image: imageParameter]) diff --git a/MTMR/TouchBarController.swift b/MTMR/TouchBarController.swift index 8023bb0..44848af 100644 --- a/MTMR/TouchBarController.swift +++ b/MTMR/TouchBarController.swift @@ -103,6 +103,20 @@ class TouchBarController: NSObject, NSTouchBarDelegate { self.reloadPreset(path: self.lastPresetPath) }), longAction: .none, parameters: [.width: .width(30), .image: .image(source: (NSImage(named: NSImage.stopProgressFreestandingTemplateName))!)]) } + + SupportedTypesHolder.sharedInstance.register(typename: "brightnessUp") { _ in + let imageParameter = GeneralParameter.image(source: #imageLiteral(resourceName: "brightnessUp")) + return (item: .staticButton(title: ""), action: .custom(closure: { + sharedBrightnessController.increase() + }), longAction: .none, parameters: [.image: imageParameter]) + } + + SupportedTypesHolder.sharedInstance.register(typename: "brightnessDown") { _ in + let imageParameter = GeneralParameter.image(source: #imageLiteral(resourceName: "brightnessDown")) + return (item: .staticButton(title: ""), action: .custom(closure: { + sharedBrightnessController.decrease() + }), longAction: .none, parameters: [.image: imageParameter]) + } if let blackListed = UserDefaults.standard.stringArray(forKey: "com.toxblh.mtmr.blackListedApps") { self.blacklistAppIdentifiers = blackListed