12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- //
- // ComPDFUIConfig.swift
- // PDF Reader Pro
- //
- // Created by wanjun on 2023/10/11.
- //
- import Cocoa
- class ComPDFUIConfig: NSObject {
- class func initializeUIConfig() {
- if let initialUserDefaultsURL = Bundle.main.url(forResource: "InitialUserDefaults", withExtension: "plist"),
- let initialUserDefaultsDict = NSDictionary(contentsOf: initialUserDefaultsURL) as? [String: Any],
- let initialValuesDict = initialUserDefaultsDict["RegisteredDefaults"] as? [String: Any] {
-
- // Set the defaults in the standard user defaults
- UserDefaults.standard.register(defaults: initialValuesDict)
-
-
- NSImage.makePDFListViewCursorImages()
-
- CPDFListViewConfig.defaultManager.annotationBorderOffset = 2
- CPDFListViewConfig.defaultManager.annotationBorderColor = NSColor(red: 48.0/255.0, green: 145.0/255.0, blue: 255.0/255.0, alpha: 1.0)
-
- CPDFKitConfig.sharedInstance().isShowFormRequiredFlagColor = false
-
- CPDFListViewConfig.defaultManager.isSaveDefault = true
- let sud = UserDefaults.standard
- if sud.object(forKey: CHighlightNoteColorKey) == nil {
-
- CPDFAnnotationConfig.standard.setColor(CPDFMarkupAnnotation.defaultColor(.highlight), toType: .highlight)
- }
-
- if sud.object(forKey: CStrikeOutNoteColorKey) == nil {
- CPDFAnnotationConfig.standard.setColor(CPDFMarkupAnnotation.defaultColor(.strikeOut), toType: .strikeOut)
- }
-
- if sud.object(forKey: CUnderlineNoteColorKey) == nil {
- CPDFAnnotationConfig.standard.setColor(CPDFMarkupAnnotation.defaultColor(.underline), toType: .underline)
- }
-
- if sud.object(forKey: CSquigglyNoteColorKey) == nil {
- CPDFAnnotationConfig.standard.setColor(CPDFMarkupAnnotation.defaultColor(.squiggly), toType: .squiggly)
- }
- }
- }
- }
|