From 7598bbd53189ecb602da372830c2cfeb57277184 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sat, 19 Sep 2026 12:07:07 -0700 Subject: [PATCH] Set timeline row height in one place. --- .../TimelineViewController+ColumnLayout.swift | 4 ++-- Mac/MainWindow/Timeline/TimelineViewController.swift | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Mac/MainWindow/Timeline/TimelineViewController+ColumnLayout.swift b/Mac/MainWindow/Timeline/TimelineViewController+ColumnLayout.swift index 0e1aa7849..ee9cfe48d 100644 --- a/Mac/MainWindow/Timeline/TimelineViewController+ColumnLayout.swift +++ b/Mac/MainWindow/Timeline/TimelineViewController+ColumnLayout.swift @@ -130,7 +130,7 @@ private extension TimelineViewController { tableView.columnAutoresizingStyle = .lastColumnOnlyAutoresizingStyle tableView.allowsColumnReordering = false tableView.allowsColumnResizing = false - tableView.rowHeight = standardRowHeight + updateTableViewRowHeight() } func configureTableViewForColumnLayout() { @@ -148,7 +148,7 @@ private extension TimelineViewController { tableView.columnAutoresizingStyle = .uniformColumnAutoresizingStyle tableView.allowsColumnReordering = true tableView.allowsColumnResizing = true - tableView.rowHeight = columnRowHeight() + updateTableViewRowHeight() // Set the name before turning autosave on so saved widths and order are read back. tableView.autosaveName = columnAutosaveName tableView.autosaveTableColumns = true diff --git a/Mac/MainWindow/Timeline/TimelineViewController.swift b/Mac/MainWindow/Timeline/TimelineViewController.swift index 606dc0e09..8fea85a59 100644 --- a/Mac/MainWindow/Timeline/TimelineViewController.swift +++ b/Mac/MainWindow/Timeline/TimelineViewController.swift @@ -209,9 +209,6 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr var standardColumn: NSTableColumn? // Set while columns are added and autosaved state is restored, which fires sortDescriptorsDidChange. var isConfiguringTableColumns = false - var standardRowHeight: CGFloat { - currentRowHeight - } private var fontSize: FontSize = AppDefaults.shared.timelineFontSize { didSet { if fontSize != oldValue { @@ -778,6 +775,11 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner, Unr fontSize = AppDefaults.shared.timelineFontSize } + /// The one place the row height is set — it depends on the layout and the font size. + func updateTableViewRowHeight() { + tableView.rowHeight = layout == .column ? columnRowHeight() : currentRowHeight + } + // MARK: - Reloading Data private func cellForRowView(_ rowView: NSView) -> NSView? { @@ -1106,10 +1108,6 @@ private extension TimelineViewController { unreadCount = count } - func updateTableViewRowHeight() { - tableView.rowHeight = layout == .column ? columnRowHeight() : currentRowHeight - } - func layoutDidChange() { performBlockAndRestoreSelection { configureTableView(for: layout)