ComPDFUIConfig.swift 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. //
  2. // ComPDFUIConfig.swift
  3. // PDF Master
  4. //
  5. // Created by wanjun on 2023/10/11.
  6. //
  7. import Cocoa
  8. class ComPDFUIConfig: NSObject {
  9. class func initializeUIConfig() {
  10. if let initialUserDefaultsURL = Bundle.main.url(forResource: "InitialUserDefaults", withExtension: "plist"),
  11. let initialUserDefaultsDict = NSDictionary(contentsOf: initialUserDefaultsURL) as? [String: Any],
  12. let initialValuesDict = initialUserDefaultsDict["RegisteredDefaults"] as? [String: Any] {
  13. // Set the defaults in the standard user defaults
  14. UserDefaults.standard.register(defaults: initialValuesDict)
  15. // App启动后,恢复部分设置
  16. KMPreferenceManager.shared.resumeDataToPDFView()
  17. UserDefaults.standard.setPDFListViewColor(NSColor.black, forKey: CFreeTextNoteFontColorKey)
  18. NSImage.makePDFListViewCursorImages()
  19. CPDFListViewConfig.defaultManager.annotationBorderOffset = 2
  20. CPDFListViewConfig.defaultManager.annotationBorderColor = NSColor(red: 23.0/255.0, green: 112.0/255.0, blue: 244.0/255.0, alpha: 1.0)
  21. CPDFKitConfig.sharedInstance().isShowFormRequiredFlagColor = false
  22. CPDFListViewConfig.defaultManager.isSaveDefault = true
  23. }
  24. }
  25. }