|
|
@ -247,14 +247,17 @@ class StatusItemHandler: NSObject { |
|
|
|
func updateCompactMenubar() { |
|
|
|
func updateCompactMenubar() { |
|
|
|
let filteredEvents = EventCenter.sharedCenter().filteredEvents |
|
|
|
let filteredEvents = EventCenter.sharedCenter().filteredEvents |
|
|
|
let calendar = EventCenter.sharedCenter().autoupdatingCalendar |
|
|
|
let calendar = EventCenter.sharedCenter().autoupdatingCalendar |
|
|
|
if menubarTitleHandler.checkForUpcomingEvents(filteredEvents, calendar: calendar) != nil { |
|
|
|
let upcomingEvent = menubarTitleHandler.checkForUpcomingEvents(filteredEvents, calendar: calendar) |
|
|
|
|
|
|
|
if upcomingEvent != nil { |
|
|
|
// Iterate and see if we're showing the calendar item view |
|
|
|
// Iterate and see if we're showing the calendar item view |
|
|
|
let upcomingEventView = retrieveUpcomingEventStatusView() |
|
|
|
let upcomingEventView = retrieveUpcomingEventStatusView() |
|
|
|
// If not, reconstruct Status Container View with another view |
|
|
|
// If not, reconstruct Status Container View with another view |
|
|
|
if upcomingEventView == nil { |
|
|
|
if upcomingEventView == nil { |
|
|
|
constructCompactView(with: true) |
|
|
|
constructCompactView(with: true) |
|
|
|
} |
|
|
|
} |
|
|
|
} else if let upcomingEventView = retrieveUpcomingEventStatusView() { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if let upcomingEventView = retrieveUpcomingEventStatusView(), upcomingEvent == nil { |
|
|
|
upcomingEventView.removeFromSuperview() |
|
|
|
upcomingEventView.removeFromSuperview() |
|
|
|
constructCompactView() // So that Status Container View reclaims the space |
|
|
|
constructCompactView() // So that Status Container View reclaims the space |
|
|
|
} |
|
|
|
} |
|
|
|