소스 검색

Use preferred font on app start and text resize

master
Matt Baer 6 년 전
부모
커밋
81964d9ffa
2개의 변경된 파일2개의 추가작업 그리고 5개의 파일을 삭제
  1. +0
    -3
      writeas/AppDelegate.swift
  2. +2
    -2
      writeas/ViewController.swift

+ 0
- 3
writeas/AppDelegate.swift 파일 보기

@@ -29,13 +29,10 @@ class AppDelegate: NSObject, NSApplicationDelegate {
let font = Preferences.getFont()
if font == Preferences.PostFont.serif {
formatFontSerifItem.state = NSOnState
vc?.setFont(.serif)
} else if font == Preferences.PostFont.sans {
formatFontSansItem.state = NSOnState
vc?.setFont(.sans)
} else if font == Preferences.PostFont.mono {
formatFontMonoItem.state = NSOnState
vc?.setFont(.mono)
}
}



+ 2
- 2
writeas/ViewController.swift 파일 보기

@@ -19,7 +19,7 @@ class ViewController: NSViewController, NSTextViewDelegate, NSUserNotificationCe

loadDocument()

writerText.font = NSFont(name: "Lora", size: Preferences.getFontSize())
writerText.font = NSFont(name: Preferences.getFont().typeface, size: Preferences.getFontSize())
writerText.isHorizontallyResizable = false
writerText.textContainerInset = NSSize(width: 16, height: 16)
writerText.isAutomaticQuoteSubstitutionEnabled = false
@@ -139,7 +139,7 @@ class ViewController: NSViewController, NSTextViewDelegate, NSUserNotificationCe
} else {
size -= 1
}
self.writerText.font = NSFont(name: "Lora", size: size)
self.writerText.font = NSFont(name: Preferences.getFont().typeface, size: size)
UserDefaults.standard.set(String(Int(size)), forKey: "editor_text_size")
configureWindow()
}


불러오는 중...
취소
저장