From 592331248ca6fcb300764c066b944b9fe64e8ad8 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Sat, 7 Aug 2021 11:46:12 -0500 Subject: [PATCH] Upcoming Event View v2.0. --- Clocker/Clocker.xcodeproj/project.pbxproj | 28 ++++ .../xcshareddata/xcschemes/Clocker.xcscheme | 3 + Clocker/Clocker/en.lproj/Panel.xib | 147 +++++++----------- .../CalendarHandler.swift | 12 ++ Clocker/Panel/ParentPanelController.swift | 35 ++++- ...ParentPanelController+UpcomingEvents.swift | 22 +++ .../UpcomingEventViewItem.swift | 22 +++ .../Upcoming Events/UpcomingEventViewItem.xib | 77 +++++++++ .../UpcomingEventsDataSource.swift | 30 ++++ 9 files changed, 277 insertions(+), 99 deletions(-) create mode 100644 Clocker/Panel/Upcoming Events/ParentPanelController+UpcomingEvents.swift create mode 100644 Clocker/Panel/Upcoming Events/UpcomingEventViewItem.swift create mode 100644 Clocker/Panel/Upcoming Events/UpcomingEventViewItem.xib create mode 100644 Clocker/Panel/Upcoming Events/UpcomingEventsDataSource.swift diff --git a/Clocker/Clocker.xcodeproj/project.pbxproj b/Clocker/Clocker.xcodeproj/project.pbxproj index 15cde59..b92f020 100755 --- a/Clocker/Clocker.xcodeproj/project.pbxproj +++ b/Clocker/Clocker.xcodeproj/project.pbxproj @@ -46,6 +46,10 @@ 3531F82226938D7700DF0111 /* GoogleDataTransport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3531F80526938D7700DF0111 /* GoogleDataTransport.framework */; }; 3531F82326938D7700DF0111 /* GoogleDataTransport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3531F80526938D7700DF0111 /* GoogleDataTransport.framework */; }; 353B5BC52698B78A0023858D /* UpcomingEventStatusItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 353B5BC42698B78A0023858D /* UpcomingEventStatusItemView.swift */; }; + 3548C45A26BECF1B00AFB533 /* UpcomingEventViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3548C45926BECF1B00AFB533 /* UpcomingEventViewItem.xib */; }; + 3548C45D26BEEF4C00AFB533 /* ParentPanelController+UpcomingEvents.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3548C45C26BEEF4C00AFB533 /* ParentPanelController+UpcomingEvents.swift */; }; + 3548C45F26BEEFB400AFB533 /* UpcomingEventsDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3548C45E26BEEFB400AFB533 /* UpcomingEventsDataSource.swift */; }; + 3548C46126BEEFE400AFB533 /* UpcomingEventViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3548C46026BEEFE400AFB533 /* UpcomingEventViewItem.swift */; }; 357391872507277500D30819 /* TimeMarkerViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 357391852507277500D30819 /* TimeMarkerViewItem.swift */; }; 357391882507277500D30819 /* HourMarkerViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = 357391862507277500D30819 /* HourMarkerViewItem.xib */; }; 3579765E2680208C009DDA6E /* ParentPanelController+ModernSlider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3579765D2680208C009DDA6E /* ParentPanelController+ModernSlider.swift */; }; @@ -119,6 +123,7 @@ 35C36FA22259ED6D002FA5C6 /* RemindersHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35C36F9F2259ED6D002FA5C6 /* RemindersHandler.swift */; }; 35C36FA42259EEC2002FA5C6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35C36FA32259EEC2002FA5C6 /* AppDelegate.swift */; }; 35DFBCEF26A8468900D6648B /* ConfigExport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35DFBCEE26A8468900D6648B /* ConfigExport.swift */; }; + 35DFBCF126A8479000D6648B /* Keys.plist in Resources */ = {isa = PBXBuildFile; fileRef = 35DFBCF026A8479000D6648B /* Keys.plist */; }; 35E65125268EDD2E00E3E1E3 /* Toasty.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35E65124268EDD2E00E3E1E3 /* Toasty.swift */; }; 9A0385BB269E3434003B5E72 /* StandardMenubarHandlerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0385BA269E3434003B5E72 /* StandardMenubarHandlerTests.swift */; }; 9A0385C0269E8891003B5E72 /* PermissionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A0385BF269E8891003B5E72 /* PermissionsTests.swift */; }; @@ -272,6 +277,10 @@ 3531F80526938D7700DF0111 /* GoogleDataTransport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GoogleDataTransport.framework; path = Frameworks/Firebase/GoogleDataTransport.framework; sourceTree = ""; }; 353B5BC42698B78A0023858D /* UpcomingEventStatusItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpcomingEventStatusItemView.swift; sourceTree = ""; }; 353B5BC72698D4BB0023858D /* hr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hr; path = hr.lproj/Localizable.strings; sourceTree = ""; }; + 3548C45926BECF1B00AFB533 /* UpcomingEventViewItem.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = UpcomingEventViewItem.xib; sourceTree = ""; }; + 3548C45C26BEEF4C00AFB533 /* ParentPanelController+UpcomingEvents.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ParentPanelController+UpcomingEvents.swift"; sourceTree = ""; }; + 3548C45E26BEEFB400AFB533 /* UpcomingEventsDataSource.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpcomingEventsDataSource.swift; sourceTree = ""; }; + 3548C46026BEEFE400AFB533 /* UpcomingEventViewItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UpcomingEventViewItem.swift; sourceTree = ""; }; 3569A44E25441F320087E254 /* pt-BR */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "pt-BR"; path = "pt-BR.lproj/Localizable.strings"; sourceTree = ""; }; 357391852507277500D30819 /* TimeMarkerViewItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeMarkerViewItem.swift; sourceTree = ""; }; 357391862507277500D30819 /* HourMarkerViewItem.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = HourMarkerViewItem.xib; sourceTree = ""; }; @@ -348,6 +357,7 @@ 35C36F9F2259ED6D002FA5C6 /* RemindersHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RemindersHandler.swift; sourceTree = ""; }; 35C36FA32259EEC2002FA5C6 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = SOURCE_ROOT; }; 35DFBCEE26A8468900D6648B /* ConfigExport.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigExport.swift; sourceTree = ""; }; + 35DFBCF026A8479000D6648B /* Keys.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Keys.plist; path = ../Internal/Keys.plist; sourceTree = ""; }; 35E65124268EDD2E00E3E1E3 /* Toasty.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Toasty.swift; sourceTree = ""; }; 9A0385BA269E3434003B5E72 /* StandardMenubarHandlerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StandardMenubarHandlerTests.swift; sourceTree = ""; }; 9A0385BF269E8891003B5E72 /* PermissionsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PermissionsTests.swift; sourceTree = ""; }; @@ -534,6 +544,17 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 3548C45B26BEEF2100AFB533 /* Upcoming Events */ = { + isa = PBXGroup; + children = ( + 3548C45C26BEEF4C00AFB533 /* ParentPanelController+UpcomingEvents.swift */, + 3548C45E26BEEFB400AFB533 /* UpcomingEventsDataSource.swift */, + 3548C46026BEEFE400AFB533 /* UpcomingEventViewItem.swift */, + 3548C45926BECF1B00AFB533 /* UpcomingEventViewItem.xib */, + ); + path = "Upcoming Events"; + sourceTree = ""; + }; 35C36EB522595834002FA5C6 /* Dependencies */ = { isa = PBXGroup; children = ( @@ -599,6 +620,7 @@ 35C36F242259D64D002FA5C6 /* Panel */ = { isa = PBXGroup; children = ( + 3548C45B26BEEF2100AFB533 /* Upcoming Events */, 35C36F632259DE9D002FA5C6 /* Rate Controller */, 35C36F522259DC9B002FA5C6 /* UI */, 35C36F512259DC85002FA5C6 /* Data Layer */, @@ -889,6 +911,7 @@ DD4F7BF913C30F9F00825C6E = { isa = PBXGroup; children = ( + 35DFBCF026A8479000D6648B /* Keys.plist */, 35B2FEE4259A2C25005DA84D /* CoreModelKit */, 35B2FED4259A2244005DA84D /* CoreLoggerKit */, 35B2FEB1259A1649005DA84D /* StartupKit */, @@ -1200,6 +1223,8 @@ 3531F7C226936C6E00DF0111 /* GoogleService-Info.plist in Resources */, 35C36F17225961DA002FA5C6 /* DateTools.bundle in Resources */, 35C36EF322595F14002FA5C6 /* WelcomeView.xib in Resources */, + 3548C45A26BECF1B00AFB533 /* UpcomingEventViewItem.xib in Resources */, + 35DFBCF126A8479000D6648B /* Keys.plist in Resources */, 35C36EF822595F14002FA5C6 /* Onboarding.storyboard in Resources */, 35C36F612259DE67002FA5C6 /* NotesPopover.xib in Resources */, 9A3169C11D2CC5AA0079FDF8 /* com.abhishek.ClockerHelper.plist in Resources */, @@ -1278,6 +1303,7 @@ 35C36F672259DF4C002FA5C6 /* ReviewController.swift in Sources */, 35C36F472259D892002FA5C6 /* Reach.swift in Sources */, 35C36EF222595F14002FA5C6 /* OnboardingWelcomeViewController.swift in Sources */, + 3548C45F26BEEFB400AFB533 /* UpcomingEventsDataSource.swift in Sources */, 35C36F732259E1AA002FA5C6 /* FloatingWindowController.swift in Sources */, 35C36F6F2259E185002FA5C6 /* CustomSliderCell.swift in Sources */, 35C36EF122595F14002FA5C6 /* OnboardingPermissionsViewController.swift in Sources */, @@ -1292,6 +1318,7 @@ 35C36F16225961DA002FA5C6 /* Date+Inits.swift in Sources */, 35C36F4F2259D981002FA5C6 /* AppDefaults.swift in Sources */, 35C36F5D2259DD96002FA5C6 /* TimezoneDataOperations.swift in Sources */, + 3548C45D26BEEF4C00AFB533 /* ParentPanelController+UpcomingEvents.swift in Sources */, 3508CC942599FFEC000E3530 /* MenubarHandler.swift in Sources */, 35C36F14225961DA002FA5C6 /* Integer+DateTools.swift in Sources */, 35C36FA22259ED6D002FA5C6 /* RemindersHandler.swift in Sources */, @@ -1335,6 +1362,7 @@ 35C36F2022596253002FA5C6 /* OneWindowController.swift in Sources */, 35C36F0E225961DA002FA5C6 /* Date+Bundle.swift in Sources */, 9AB6F1672259D23200A44663 /* PermissionsViewController.swift in Sources */, + 3548C46126BEEFE400AFB533 /* UpcomingEventViewItem.swift in Sources */, 9AB6F1642259D1B900A44663 /* ParentViewController.swift in Sources */, 35C36F1C225961DA002FA5C6 /* TimePeriodChain.swift in Sources */, 3508CCAA259A0027000E3530 /* StatusContainerView.swift in Sources */, diff --git a/Clocker/Clocker.xcodeproj/xcshareddata/xcschemes/Clocker.xcscheme b/Clocker/Clocker.xcodeproj/xcshareddata/xcschemes/Clocker.xcscheme index 797996c..b23767c 100644 --- a/Clocker/Clocker.xcodeproj/xcshareddata/xcschemes/Clocker.xcscheme +++ b/Clocker/Clocker.xcodeproj/xcshareddata/xcschemes/Clocker.xcscheme @@ -78,6 +78,9 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + enableAddressSanitizer = "YES" + enableASanStackUseAfterReturn = "YES" + enableUBSanitizer = "YES" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Clocker/Clocker/en.lproj/Panel.xib b/Clocker/Clocker/en.lproj/Panel.xib index e08f14a..58e34da 100755 --- a/Clocker/Clocker/en.lproj/Panel.xib +++ b/Clocker/Clocker/en.lproj/Panel.xib @@ -1,16 +1,15 @@ - + - + + - - @@ -21,7 +20,6 @@ - @@ -32,8 +30,9 @@ + + - @@ -44,7 +43,7 @@ - + @@ -53,13 +52,13 @@ - + - + - + @@ -78,11 +77,11 @@ - + - + @@ -93,7 +92,7 @@ - + @@ -105,7 +104,7 @@ - + @@ -117,7 +116,7 @@ - + @@ -128,7 +127,7 @@ - + @@ -136,7 +135,7 @@ - + @@ -214,11 +213,11 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - - - + + + + @@ -689,7 +652,9 @@ - + + + diff --git a/Clocker/Events and Reminders/CalendarHandler.swift b/Clocker/Events and Reminders/CalendarHandler.swift index f052868..fac3417 100644 --- a/Clocker/Events and Reminders/CalendarHandler.swift +++ b/Clocker/Events and Reminders/CalendarHandler.swift @@ -191,6 +191,18 @@ extension EventCenter { return filteredAllDayEvent } + + func upcomingEventsForDay(_: [EventInfo]) -> [EventInfo]? { + if calendarAccessDenied() || calendarAccessNotDetermined() { + return nil + } + + let relevantEvents = filteredEvents[autoupdatingCalendar.startOfDay(for: Date())] ?? [] + + return relevantEvents.filter { + $0.event.startDate.timeIntervalSinceNow > -300 + } + } func initializeStoreIfNeccesary() { if eventStore == nil { diff --git a/Clocker/Panel/ParentPanelController.swift b/Clocker/Panel/ParentPanelController.swift index 1c6dc9a..94ce3c4 100644 --- a/Clocker/Panel/ParentPanelController.swift +++ b/Clocker/Panel/ParentPanelController.swift @@ -95,6 +95,11 @@ class ParentPanelController: NSWindowController { @IBOutlet var modernContainerView: ModernSliderContainerView! @IBOutlet var goBackwardsButton: NSButton! @IBOutlet var goForwardButton: NSButton! + + // Upcoming Events + @IBOutlet var upcomingEventCollectionView: NSCollectionView! + @IBOutlet var upcomingEventContainerView: NSView! + public let upcomingEventsDataSource = UpcomingEventsDataSource() var defaultPreferences: [Data] { return DataStore.shared().timezones() @@ -219,6 +224,7 @@ class ParentPanelController: NSWindowController { } setupModernSliderIfNeccessary() + setupUpcomingEventViewCollectionViewIfNeccesary() if roundedDateView != nil { setupRoundedDateView() @@ -314,11 +320,13 @@ class ParentPanelController: NSWindowController { if eventCenter.calendarAccessGranted() { // Nice. Events will be retrieved when we open the panel } else if eventCenter.calendarAccessNotDetermined() { - nextEventLabel.stringValue = NSLocalizedString("See your next Calendar event here.", - comment: "Next Event Label for no Calendar access") - setCalendarButtonTitle(buttonTitle: NSLocalizedString("Click here to start.", - comment: "Button Title for no Calendar access")) - calendarColorView.layer?.backgroundColor = NSColor(red: 97 / 255.0, green: 194 / 255.0, blue: 80 / 255.0, alpha: 1.0).cgColor + if nextEventLabel != nil { + nextEventLabel.stringValue = NSLocalizedString("See your next Calendar event here.", + comment: "Next Event Label for no Calendar access") + setCalendarButtonTitle(buttonTitle: NSLocalizedString("Click here to start.", + comment: "Button Title for no Calendar access")) + calendarColorView.layer?.backgroundColor = NSColor(red: 97 / 255.0, green: 194 / 255.0, blue: 80 / 255.0, alpha: 1.0).cgColor + } } else { removeUpcomingEventView() } @@ -353,9 +361,6 @@ class ParentPanelController: NSWindowController { if upcomingEventView?.isHidden == false { upcomingEventView?.layer?.backgroundColor = NSColor.clear.cgColor - nextEventLabel.textColor = sharedThemer.mainTextColor() - whiteRemoveButton.image = sharedThemer.removeImage() - setCalendarButtonTitle(buttonTitle: calendarButton.title) } shutdownButton.image = sharedThemer.shutdownImage() @@ -832,6 +837,14 @@ class ParentPanelController: NSWindowController { if let events = eventCenter.eventsForDate[NSCalendar.autoupdatingCurrent.startOfDay(for: now)], events.isEmpty == false { OperationQueue.main.addOperation { + if self.upcomingEventCollectionView != nil, + let upcomingEvents = eventCenter.upcomingEventsForDay(events) { + self.upcomingEventsDataSource.updateEventsDataSource(upcomingEvents) + self.upcomingEventCollectionView.reloadData() + return + } + + guard let upcomingEvent = eventCenter.nextOccuring(events) else { self.setPlaceholdersForUpcomingCalendarView() if #available(OSX 10.14, *) { @@ -863,6 +876,12 @@ class ParentPanelController: NSWindowController { } } } else { + if self.upcomingEventCollectionView != nil { + self.upcomingEventsDataSource.updateEventsDataSource([]) + self.upcomingEventCollectionView.reloadData() + return + } + setPlaceholdersForUpcomingCalendarView() if #available(OSX 10.14, *) { PerfLogger.endMarker("Fetch Calendar Events") diff --git a/Clocker/Panel/Upcoming Events/ParentPanelController+UpcomingEvents.swift b/Clocker/Panel/Upcoming Events/ParentPanelController+UpcomingEvents.swift new file mode 100644 index 0000000..fb493f2 --- /dev/null +++ b/Clocker/Panel/Upcoming Events/ParentPanelController+UpcomingEvents.swift @@ -0,0 +1,22 @@ +// Copyright © 2015 Abhishek Banthia + +import Foundation + +var avenirLightFont: NSFont { + if let avenirFont = NSFont(name: "Avenir-Light", size: 12) { + return avenirFont + } + return NSFont.systemFont(ofSize: 12) +} + +extension ParentPanelController { + func setupUpcomingEventViewCollectionViewIfNeccesary() { + if upcomingEventCollectionView != nil { + upcomingEventCollectionView.enclosingScrollView?.scrollerInsets = NSEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) + upcomingEventCollectionView.enclosingScrollView?.backgroundColor = NSColor.clear + upcomingEventCollectionView.setAccessibility("UpcomingEventCollectionView") + upcomingEventCollectionView.dataSource = upcomingEventsDataSource + upcomingEventCollectionView.delegate = upcomingEventsDataSource + } + } +} diff --git a/Clocker/Panel/Upcoming Events/UpcomingEventViewItem.swift b/Clocker/Panel/Upcoming Events/UpcomingEventViewItem.swift new file mode 100644 index 0000000..1d94ed2 --- /dev/null +++ b/Clocker/Panel/Upcoming Events/UpcomingEventViewItem.swift @@ -0,0 +1,22 @@ +// Copyright © 2015 Abhishek Banthia + +import Foundation + +class UpcomingEventViewItem: NSCollectionViewItem { + static let reuseIdentifier = NSUserInterfaceItemIdentifier("UpcomingEventViewItem") + @IBOutlet weak var calendarColorView: NSView! + + @IBOutlet weak var eventTitleLabel: NSTextField! + @IBOutlet weak var eventSubtitleLabel: NSButton! + + func setup(_ title: String, _ subtitle: String, _ color: NSColor) { + calendarColorView.layer?.backgroundColor = color.cgColor + eventTitleLabel.stringValue = title + eventSubtitleLabel.stringValue = subtitle + } + + override var acceptsFirstResponder: Bool { + return false + } + +} diff --git a/Clocker/Panel/Upcoming Events/UpcomingEventViewItem.xib b/Clocker/Panel/Upcoming Events/UpcomingEventViewItem.xib new file mode 100644 index 0000000..93219ce --- /dev/null +++ b/Clocker/Panel/Upcoming Events/UpcomingEventViewItem.xib @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Clocker/Panel/Upcoming Events/UpcomingEventsDataSource.swift b/Clocker/Panel/Upcoming Events/UpcomingEventsDataSource.swift new file mode 100644 index 0000000..0e282eb --- /dev/null +++ b/Clocker/Panel/Upcoming Events/UpcomingEventsDataSource.swift @@ -0,0 +1,30 @@ +// Copyright © 2015 Abhishek Banthia + +import Foundation + +class UpcomingEventsDataSource: NSObject, NSCollectionViewDataSource, NSCollectionViewDelegateFlowLayout { + private var upcomingEvents: [EventInfo] = [] + + func updateEventsDataSource(_ events: [EventInfo]) { + upcomingEvents = events + } + + func collectionView(_: NSCollectionView, numberOfItemsInSection _: Int) -> Int { + return upcomingEvents.count + } + + func collectionView(_ collectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem { + let item = collectionView.makeItem(withIdentifier: UpcomingEventViewItem.reuseIdentifier, for: indexPath) as! UpcomingEventViewItem + let currentEventInfo = upcomingEvents[indexPath.item] + + let upcomingEventSubtitle = currentEventInfo.isAllDay ? "All-Day" : currentEventInfo.metadataForMeeting() + item.setup(currentEventInfo.event.title, upcomingEventSubtitle, currentEventInfo.event.calendar.color) + return item + } + + func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> NSSize { + let currentEventInfo = upcomingEvents[indexPath.item] + let prefferedSize = avenirLightFont.size(currentEventInfo.event.title, 250, attributes: [NSAttributedString.Key.font: avenirLightFont,]) + return NSSize(width: prefferedSize.width, height: 50) + } +}