diff --git a/Clocker/Panel/Upcoming Events/UpcomingEventsDataSource.swift b/Clocker/Panel/Upcoming Events/UpcomingEventsDataSource.swift index 85ec97f..4fec084 100644 --- a/Clocker/Panel/Upcoming Events/UpcomingEventsDataSource.swift +++ b/Clocker/Panel/Upcoming Events/UpcomingEventsDataSource.swift @@ -60,7 +60,8 @@ class UpcomingEventsDataSource: NSObject, NSCollectionViewDataSource, NSCollecti } else { let currentEventInfo = upcomingEvents[indexPath.item] let bufferWidth: CGFloat = currentEventInfo.meetingURL != nil ? 60.0 : 20.0 - let attributedString = NSAttributedString(string: currentEventInfo.event.title, attributes: [NSAttributedString.Key.font: avenirBookFont]) + let longerString = currentEventInfo.event.title.count >= currentEventInfo.metadataForMeeting().count ? currentEventInfo.event.title : currentEventInfo.metadataForMeeting() + let attributedString = NSAttributedString(string: longerString ?? CLEmptyString, attributes: [NSAttributedString.Key.font: avenirBookFont]) let maxWidth = min(attributedString.size().width + bufferWidth, UpcomingEventsDataSource.panelWidth / 2) return NSSize(width: maxWidth, height: collectionView.frame.height - 20) }