Set timeline row height in one place.

This commit is contained in:
Brent Simmons committed 2026-09-19 12:07:07 -07:00
1 parent c7239e2e45
commit 7598bbd531
2 files changed
+7 -9

No files matched your search

@@ -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
@@ -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)