From ef22f3280c99b08efc85efd3c113cc950ffd580d Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sat, 19 Sep 2026 11:31:19 -0700 Subject: [PATCH] Line up column titles better. --- .../Timeline/Cell/TimelineColumnCellViews.swift | 2 +- Mac/MainWindow/Timeline/TimelineColumn.swift | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Mac/MainWindow/Timeline/Cell/TimelineColumnCellViews.swift b/Mac/MainWindow/Timeline/Cell/TimelineColumnCellViews.swift index 859d64a1a..617a4d5b4 100644 --- a/Mac/MainWindow/Timeline/Cell/TimelineColumnCellViews.swift +++ b/Mac/MainWindow/Timeline/Cell/TimelineColumnCellViews.swift @@ -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 diff --git a/Mac/MainWindow/Timeline/TimelineColumn.swift b/Mac/MainWindow/Timeline/TimelineColumn.swift index fc79a9b16..10b6ab294 100644 --- a/Mac/MainWindow/Timeline/TimelineColumn.swift +++ b/Mac/MainWindow/Timeline/TimelineColumn.swift @@ -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) + } +}