mirror of
https://github.com/Toxblh/MTMR.git
synced 2026-01-10 17:08:39 +00:00
* action for battery plugin
This commit is contained in:
parent
9abb17ee76
commit
d76e16b9e6
@ -9,12 +9,11 @@
|
||||
import IOKit.ps
|
||||
import Foundation
|
||||
|
||||
class BatteryBarItem: NSCustomTouchBarItem {
|
||||
class BatteryBarItem: CustomButtonTouchBarItem {
|
||||
private var timer: Timer!
|
||||
private let button = NSButton(title: "", target: nil, action: nil)
|
||||
|
||||
override init(identifier: NSTouchBarItem.Identifier) {
|
||||
super.init(identifier: identifier)
|
||||
init(identifier: NSTouchBarItem.Identifier, onTap: @escaping () -> ()) {
|
||||
super.init(identifier: identifier, title: " ", onTap: onTap)
|
||||
self.view = button
|
||||
button.bezelColor = .clear
|
||||
|
||||
|
||||
@ -172,7 +172,7 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
|
||||
case .timeButton(formatTemplate: let template):
|
||||
barItem = TimeTouchBarItem(identifier: identifier, formatTemplate: template)
|
||||
case .battery():
|
||||
barItem = BatteryBarItem(identifier: identifier)
|
||||
barItem = BatteryBarItem(identifier: identifier, onTap: action)
|
||||
case .dock:
|
||||
barItem = AppScrubberTouchBarItem(identifier: identifier)
|
||||
case .volume:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user