Line up column titles better.

This commit is contained in:
Brent Simmons committed 2026-09-19 11:31:19 -07:00
1 parent 795dafc960
commit ef22f3280c
2 files changed
+15 -2

No files matched your search

@@ -11,7 +11,7 @@ import AppKit
// Cell views for the timeline’s column layout. Selection state arrives through backgroundStyle,
// which the standard NSTableRowView sets, so no custom row view is needed.
private let columnCellHorizontalPadding: CGFloat = 4.0
private let columnCellHorizontalPadding: CGFloat = 8.0
private let feedIconDimension: CGFloat = 16.0
private let feedIconMarginRight: CGFloat = 5.0
+14 -1
View File
@@ -94,7 +94,7 @@ enum TimelineColumn: String, CaseIterable {
@MainActor func makeTableColumn() -> NSTableColumn {
let column = NSTableColumn(identifier: identifier)
column.title = headerTitle
column.headerCell = TimelineColumnHeaderCell(textCell: headerTitle)
column.headerToolTip = headerToolTip
column.sortDescriptorPrototype = NSSortDescriptor(key: sortKey.rawValue, ascending: sortsAscendingFirst)
@@ -125,3 +125,16 @@ enum TimelineColumn: String, CaseIterable {
return column
}
}
/// Adds a little room between the column separator and the title, as Mail has.
final class TimelineColumnHeaderCell: NSTableHeaderCell {
private static let titleLeftPadding: CGFloat = 6.0
override func drawInterior(withFrame cellFrame: NSRect, in controlView: NSView) {
var frame = cellFrame
frame.origin.x += Self.titleLeftPadding
frame.size.width -= Self.titleLeftPadding
super.drawInterior(withFrame: frame, in: controlView)
}
}