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:
parent
f5488102d0
commit
f5a2259333
@ -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 {
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -18,7 +18,7 @@ class InputSourceBarItem: CustomButtonTouchBarItem {
|
||||
|
||||
observeIputSourceChangedNotification()
|
||||
textInputSourceDidChange()
|
||||
tapClosure = { [weak self] in
|
||||
actions[.singleTap] = { [weak self] in
|
||||
self?.switchInputSource()
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user