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.
This commit is contained in:
Jon Parise
2024-04-12 09:01:20 -07:00
parent 260f617f92
commit c09035f228

View File

@ -52,11 +52,13 @@ class TerminalWindow: NSWindow {
// Used to set the titlebar font. // Used to set the titlebar font.
var titlebarFont: NSFont? { var titlebarFont: NSFont? {
didSet { didSet {
titlebarTextField?.font = titlebarFont let font = titlebarFont ?? NSFont.titleBarFont(ofSize: NSFont.systemFontSize)
titlebarTextField?.font = font
tab.attributedTitle = attributedTitle tab.attributedTitle = attributedTitle
if let toolbar = toolbar as? TerminalToolbar { if let toolbar = toolbar as? TerminalToolbar {
toolbar.titleFont = titlebarFont toolbar.titleFont = font
} }
} }
} }