mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-12-02 18:32:55 +00:00
💄 Enable trunction with NSMutableParagraphStyle
This commit is contained in:
2 files changed
+6
-2
No files matched your search
@@ -92,12 +92,13 @@ class MainTimelineFeedCell: UITableViewCell {
|
||||
let paragraphStyle = NSMutableParagraphStyle()
|
||||
paragraphStyle.minimumLineHeight = UIFont.preferredFont(forTextStyle: .headline).pointSize
|
||||
paragraphStyle.maximumLineHeight = UIFont.preferredFont(forTextStyle: .headline).pointSize
|
||||
paragraphStyle.lineBreakMode = .byTruncatingTail
|
||||
let titleAttributes: [NSAttributedString.Key: Any] = [
|
||||
.font: UIFont.preferredFont(forTextStyle: .headline),
|
||||
.paragraphStyle: paragraphStyle,
|
||||
.foregroundColor: isSelected ? UIColor.white : UIColor.label
|
||||
]
|
||||
let titleWithNewline = cellData.title + "\n"
|
||||
let titleWithNewline = cellData.title + (cellData.summary != "" ? "\n" : "" )
|
||||
let titleAttributed = NSAttributedString(string: titleWithNewline, attributes: titleAttributes)
|
||||
attributedCellText.append(titleAttributed)
|
||||
}
|
||||
@@ -105,6 +106,7 @@ class MainTimelineFeedCell: UITableViewCell {
|
||||
let paragraphStyle = NSMutableParagraphStyle()
|
||||
paragraphStyle.minimumLineHeight = UIFont.preferredFont(forTextStyle: .body).pointSize
|
||||
paragraphStyle.maximumLineHeight = UIFont.preferredFont(forTextStyle: .body).pointSize
|
||||
paragraphStyle.lineBreakMode = .byTruncatingTail
|
||||
let summaryAttributes: [NSAttributedString.Key: Any] = [
|
||||
.font: UIFont.preferredFont(forTextStyle: .body),
|
||||
.paragraphStyle: paragraphStyle,
|
||||
|
||||
@@ -121,12 +121,13 @@ class MainTimelineIconFeedCell: UITableViewCell {
|
||||
let paragraphStyle = NSMutableParagraphStyle()
|
||||
paragraphStyle.minimumLineHeight = UIFont.preferredFont(forTextStyle: .headline).pointSize
|
||||
paragraphStyle.maximumLineHeight = UIFont.preferredFont(forTextStyle: .headline).pointSize
|
||||
paragraphStyle.lineBreakMode = .byTruncatingTail
|
||||
let titleAttributes: [NSAttributedString.Key: Any] = [
|
||||
.font: UIFont.preferredFont(forTextStyle: .headline),
|
||||
.paragraphStyle: paragraphStyle,
|
||||
.foregroundColor: isSelected ? UIColor.white : UIColor.label
|
||||
]
|
||||
let titleWithNewline = cellData.title + "\n"
|
||||
let titleWithNewline = cellData.title + (cellData.summary != "" ? "\n" : "" )
|
||||
let titleAttributed = NSAttributedString(string: titleWithNewline, attributes: titleAttributes)
|
||||
attributedCellText.append(titleAttributed)
|
||||
}
|
||||
@@ -134,6 +135,7 @@ class MainTimelineIconFeedCell: UITableViewCell {
|
||||
let paragraphStyle = NSMutableParagraphStyle()
|
||||
paragraphStyle.minimumLineHeight = UIFont.preferredFont(forTextStyle: .body).pointSize
|
||||
paragraphStyle.maximumLineHeight = UIFont.preferredFont(forTextStyle: .body).pointSize
|
||||
paragraphStyle.lineBreakMode = .byTruncatingTail
|
||||
let summaryAttributes: [NSAttributedString.Key: Any] = [
|
||||
.font: UIFont.preferredFont(forTextStyle: .body),
|
||||
.paragraphStyle: paragraphStyle,
|
||||
|
||||
Reference in new issue
Block a user