From c09035f228562fd2fc4fc2139afeeacf9ec324b4 Mon Sep 17 00:00:00 2001 From: Jon Parise Date: Fri, 12 Apr 2024 09:01:20 -0700 Subject: [PATCH] macos: fall back to the system titlebar font We allow titlebarFont to be nil to differentiate between "system" (nil) and "custom" (non-nil) behavior. For the "system" case, we need to use the system _titlebar_ font (rather than just the default system font), to match the system's conventions. --- macos/Sources/Features/Terminal/TerminalWindow.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/macos/Sources/Features/Terminal/TerminalWindow.swift b/macos/Sources/Features/Terminal/TerminalWindow.swift index 339a5fde0..dcc6bfaf5 100644 --- a/macos/Sources/Features/Terminal/TerminalWindow.swift +++ b/macos/Sources/Features/Terminal/TerminalWindow.swift @@ -52,11 +52,13 @@ class TerminalWindow: NSWindow { // Used to set the titlebar font. var titlebarFont: NSFont? { didSet { - titlebarTextField?.font = titlebarFont + let font = titlebarFont ?? NSFont.titleBarFont(ofSize: NSFont.systemFontSize) + + titlebarTextField?.font = font tab.attributedTitle = attributedTitle if let toolbar = toolbar as? TerminalToolbar { - toolbar.titleFont = titlebarFont + toolbar.titleFont = font } } }