mirror of
https://github.com/Toxblh/MTMR.git
synced 2026-01-11 09:28:38 +00:00
Remove unused code
This commit is contained in:
parent
f5488102d0
commit
f5a2259333
@ -9,16 +9,6 @@
|
|||||||
import Cocoa
|
import Cocoa
|
||||||
|
|
||||||
class CustomButtonTouchBarItem: NSCustomTouchBarItem, NSGestureRecognizerDelegate {
|
class CustomButtonTouchBarItem: NSCustomTouchBarItem, NSGestureRecognizerDelegate {
|
||||||
var tapClosure: (() -> Void)? {
|
|
||||||
didSet {
|
|
||||||
actions[.singleTap] = tapClosure
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var longTapClosure: (() -> Void)? {
|
|
||||||
didSet {
|
|
||||||
actions[.longTap] = longTapClosure
|
|
||||||
}
|
|
||||||
}
|
|
||||||
typealias TriggerClosure = (() -> Void)?
|
typealias TriggerClosure = (() -> Void)?
|
||||||
var actions: [Action.Trigger: TriggerClosure] = [:] {
|
var actions: [Action.Trigger: TriggerClosure] = [:] {
|
||||||
didSet {
|
didSet {
|
||||||
|
|||||||
@ -323,10 +323,10 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if let action = self.action(forItem: item), let item = barItem as? CustomButtonTouchBarItem {
|
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 {
|
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 {
|
if let touchBarItem = barItem as? CustomButtonTouchBarItem {
|
||||||
|
|||||||
@ -82,10 +82,10 @@ class AppScrubberTouchBarItem: NSCustomTouchBarItem {
|
|||||||
public func createAppButton(for app: DockItem) -> DockBarItem {
|
public func createAppButton(for app: DockItem) -> DockBarItem {
|
||||||
let item = DockBarItem(app)
|
let item = DockBarItem(app)
|
||||||
item.isBordered = false
|
item.isBordered = false
|
||||||
item.tapClosure = { [weak self] in
|
item.actions[.singleTap] = { [weak self] in
|
||||||
self?.switchToApp(app: app)
|
self?.switchToApp(app: app)
|
||||||
}
|
}
|
||||||
item.longTapClosure = { [weak self] in
|
item.actions[.longTap] = { [weak self] in
|
||||||
self?.handleHalfLongPress(item: app)
|
self?.handleHalfLongPress(item: app)
|
||||||
}
|
}
|
||||||
item.killAppClosure = {[weak self] in
|
item.killAppClosure = {[weak self] in
|
||||||
|
|||||||
@ -18,7 +18,7 @@ class InputSourceBarItem: CustomButtonTouchBarItem {
|
|||||||
|
|
||||||
observeIputSourceChangedNotification()
|
observeIputSourceChangedNotification()
|
||||||
textInputSourceDidChange()
|
textInputSourceDidChange()
|
||||||
tapClosure = { [weak self] in
|
actions[.singleTap] = { [weak self] in
|
||||||
self?.switchInputSource()
|
self?.switchInputSource()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user