Browse Source

Fix truncated upcoming event cells.

pull/113/head
Abhishek 2 years ago
parent
commit
45e1189c77
  1. 3
      Clocker/Panel/Upcoming Events/UpcomingEventsDataSource.swift

3
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)
}

Loading…
Cancel
Save