diff --git a/src/ui/generic-components/text/TextArea.swift b/src/ui/generic-components/text/TextArea.swift index 972301944..6cac028de 100644 --- a/src/ui/generic-components/text/TextArea.swift +++ b/src/ui/generic-components/text/TextArea.swift @@ -2,6 +2,7 @@ import Cocoa class TextArea: NSTextField, NSTextFieldDelegate { static let padding = CGFloat(5) + static let interLineFactor = CGFloat(1.6) var callback: (() -> Void)! convenience init(_ nCharactersWide: CGFloat, _ nLinesHigh: Int, _ placeholder: String, _ callback: (() -> Void)? = nil) { @@ -10,7 +11,7 @@ class TextArea: NSTextField, NSTextFieldDelegate { delegate = self cell = TextFieldCell(placeholder, nLinesHigh == 1) let width: CGFloat = (font!.xHeight * nCharactersWide + TextArea.padding * 2).rounded() - let height: CGFloat = (fittingSize.height * CGFloat(nLinesHigh) + TextArea.padding * 2).rounded() + let height: CGFloat = (NSFont.systemFontSize * TextArea.interLineFactor * CGFloat(nLinesHigh) + TextArea.padding * 2).rounded() fit(width, height) } diff --git a/src/ui/preferences-window/tabs/BlacklistsTab.swift b/src/ui/preferences-window/tabs/BlacklistsTab.swift index c1959cc14..823d89d07 100644 --- a/src/ui/preferences-window/tabs/BlacklistsTab.swift +++ b/src/ui/preferences-window/tabs/BlacklistsTab.swift @@ -4,10 +4,10 @@ import Sparkle class BlacklistsTab { static func initTab() -> NSView { let dontShowBlacklistLabel = NSTextField(labelWithString: NSLocalizedString("Don’t show windows from these apps", comment: "")) - let dontShowBlacklist = LabelAndControl.makeTextArea(50, 3, Preferences.dontShowBlacklist.joined(separator: "\n"), "dontShowBlacklist") + let dontShowBlacklist = LabelAndControl.makeTextArea(50, 6, Preferences.dontShowBlacklist.joined(separator: "\n"), "dontShowBlacklist") let disableShortcutsBlacklistLabel = NSTextField(labelWithString: NSLocalizedString("Ignore shortcuts while a window from these apps is active", comment: "")) let disableShortcutsBlacklistCheckbox = LabelAndControl.makeLabelWithCheckbox(NSLocalizedString("Only if the window is fullscreen", comment: ""), "disableShortcutsBlacklistOnlyFullscreen", labelPosition: .right) - let disableShortcutsBlacklist = LabelAndControl.makeTextArea(50, 3, Preferences.disableShortcutsBlacklist.joined(separator: "\n"), "disableShortcutsBlacklist") + let disableShortcutsBlacklist = LabelAndControl.makeTextArea(50, 6, Preferences.disableShortcutsBlacklist.joined(separator: "\n"), "disableShortcutsBlacklist") let grid = GridView([ [dontShowBlacklistLabel],