Skip to content

Commit

Permalink
Fix truncated upcoming event cells.
Browse files Browse the repository at this point in the history
  • Loading branch information
n0shake committed Aug 10, 2022
1 parent c9ec6bc commit 45e1189
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Clocker/Panel/Upcoming Events/UpcomingEventsDataSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 45e1189

Please sign in to comment.