mirror of
https://github.com/Toxblh/MTMR.git
synced 2026-01-10 00:58:37 +00:00
Made button blue for current/past events
This commit is contained in:
parent
4bfa31d96e
commit
de555a1265
@ -145,8 +145,10 @@ class UpNextScrubberTouchBarItem: NSCustomTouchBarItem {
|
||||
|
||||
|
||||
func getBackgroundColor(startDate: Date) -> NSColor {
|
||||
let distance = abs(Date().timeIntervalSinceReferenceDate/60 - startDate.timeIntervalSinceReferenceDate/60) // Get time difference in minutes
|
||||
if(distance < 30 as TimeInterval) { // Less than 30 minutes, backround is red
|
||||
let distance = Date().timeIntervalSinceReferenceDate/60 - startDate.timeIntervalSinceReferenceDate/60 // Get time difference in minutes
|
||||
if (distance < 0 as TimeInterval) { // If it's in the past, draw as blue
|
||||
return NSColor.systemBlue
|
||||
} else if (distance < 30 as TimeInterval) { // Less than 30 minutes, backround is red
|
||||
return NSColor.systemRed
|
||||
}
|
||||
return NSColor.clear
|
||||
|
||||
Loading…
Reference in New Issue
Block a user