mirror of
https://github.com/Toxblh/MTMR.git
synced 2026-01-11 09:28:38 +00:00
+ Dirty hack for show actual status for NightShift
This commit is contained in:
parent
eee4082a1a
commit
c6b6f7bbd5
@ -1,5 +1,5 @@
|
||||
//
|
||||
// nightShift.swift
|
||||
// NightShiftBarItem.swift
|
||||
// MTMR
|
||||
//
|
||||
// Created by Anton Palgunov on 28/08/2018.
|
||||
@ -10,6 +10,7 @@ import Foundation
|
||||
|
||||
class NightShiftBarItem: CustomButtonTouchBarItem {
|
||||
private let nsclient = CBBlueLightClient()
|
||||
private var timer: Timer!
|
||||
|
||||
private var blueLightStatus: Status {
|
||||
var status: Status = Status()
|
||||
@ -32,6 +33,8 @@ class NightShiftBarItem: CustomButtonTouchBarItem {
|
||||
|
||||
self.tapClosure = { [weak self] in self?.nightShiftAction() }
|
||||
|
||||
timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(refresh), userInfo: nil, repeats: true)
|
||||
|
||||
self.refresh()
|
||||
}
|
||||
|
||||
@ -44,7 +47,7 @@ class NightShiftBarItem: CustomButtonTouchBarItem {
|
||||
self.refresh()
|
||||
}
|
||||
|
||||
func refresh() {
|
||||
@objc func refresh() {
|
||||
self.image = isNightShiftEnabled ? #imageLiteral(resourceName: "nightShiftOn") : #imageLiteral(resourceName: "nightShiftOff")
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user