Fix opening font panel for font setting

This commit is contained in:
1024jp 2018-04-07 17:30:12 +09:00
parent 364abcba02
commit e158e7b9a5
7 changed files with 9 additions and 4 deletions

View File

@ -39,6 +39,7 @@ unreleased
### Fixes
- Fix a possible crash with continuous find/replacement.
- Fix an issue where the font settings cannot be changed on macOS 10.12.
- Fix an issue where the find result in the input field of the find panel did not clear when a new find string was set from the find history menu.

View File

@ -72,6 +72,7 @@
<ul>
<li>Fix a possible crash with continuous find/replacement.</li>
<li>Fix an issue where the font settings cannot be changed on macOS 10.12.</li>
<li>Fix an issue where the find result in the input field of the find panel did not clear when a new find string was set from the find history menu.</li>
</ul>
</section>

View File

@ -72,6 +72,7 @@
<ul>
<li>検索/置換を連続で繰り返したときにクラッシュしえた潜在的な不具合を修正</li>
<li>macOS 10.12でフォント設定が変更できなかった不具合を修正</li>
<li>検索パネルにおいて、検索文字が履歴メニューから入力されたときに過去の検索結果がクリアされなかった不具合を修正</li>
</ul>
</section>

View File

@ -576,8 +576,9 @@ extension AppearancePaneController {
/// show font panel
@IBAction func showFonts(_ sender: Any?) {
guard let font = NSFont(name: UserDefaults.standard[.fontName]!,
size: UserDefaults.standard[.fontSize]) else { return }
let name = UserDefaults.standard[.fontName]
let size = UserDefaults.standard[.fontSize]
let font = NSFont(name: name ?? "", size: size) ?? NSFont.userFont(ofSize: size)!
NSFontManager.shared.setSelectedFont(font, isMultiple: false)
NSFontManager.shared.orderFrontFontPanel(sender)

View File

@ -125,8 +125,9 @@ extension PrintPaneController {
/// show font panel
@IBAction func showFonts(_ sender: Any?) {
guard let font = NSFont(name: UserDefaults.standard[.printFontName]!,
size: UserDefaults.standard[.printFontSize]) else { return }
let name = UserDefaults.standard[.printFontName]
let size = UserDefaults.standard[.printFontSize]
let font = NSFont(name: name ?? "", size: size) ?? NSFont.userFont(ofSize: size)!
NSFontManager.shared.setSelectedFont(font, isMultiple: false)
NSFontManager.shared.orderFrontFontPanel(sender)