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

Remove unused code

This commit is contained in:
Matteo Piccina 2020-07-30 19:34:56 +02:00
parent f5488102d0
commit f5a2259333
4 changed files with 5 additions and 15 deletions

View File

@ -9,16 +9,6 @@
import Cocoa
class CustomButtonTouchBarItem: NSCustomTouchBarItem, NSGestureRecognizerDelegate {
var tapClosure: (() -> Void)? {
didSet {
actions[.singleTap] = tapClosure
}
}
var longTapClosure: (() -> Void)? {
didSet {
actions[.longTap] = longTapClosure
}
}
typealias TriggerClosure = (() -> Void)?
var actions: [Action.Trigger: TriggerClosure] = [:] {
didSet {

View File

@ -323,10 +323,10 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
}
if let action = self.action(forItem: item), let item = barItem as? CustomButtonTouchBarItem {
item.tapClosure = action
item.actions[.singleTap] = action
}
if let longAction = self.longAction(forItem: item), let item = barItem as? CustomButtonTouchBarItem {
item.longTapClosure = longAction
item.actions[.longTap] = longAction
}
if let touchBarItem = barItem as? CustomButtonTouchBarItem {

View File

@ -82,10 +82,10 @@ class AppScrubberTouchBarItem: NSCustomTouchBarItem {
public func createAppButton(for app: DockItem) -> DockBarItem {
let item = DockBarItem(app)
item.isBordered = false
item.tapClosure = { [weak self] in
item.actions[.singleTap] = { [weak self] in
self?.switchToApp(app: app)
}
item.longTapClosure = { [weak self] in
item.actions[.longTap] = { [weak self] in
self?.handleHalfLongPress(item: app)
}
item.killAppClosure = {[weak self] in

View File

@ -18,7 +18,7 @@ class InputSourceBarItem: CustomButtonTouchBarItem {
observeIputSourceChangedNotification()
textInputSourceDidChange()
tapClosure = { [weak self] in
actions[.singleTap] = { [weak self] in
self?.switchInputSource()
}
}