ComPDFUIConfig.m 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // ComPDFUIConfig.m
  3. // ComPDFKit
  4. //
  5. // Copyright © 2014-2022 PDF Technologies, Inc. All Rights Reserved.
  6. //
  7. // THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW
  8. // AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT.
  9. // UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
  10. // This notice may not be removed from this file.
  11. //
  12. #import "ComPDFUIConfig.h"
  13. #import <ComPDFKit/ComPDFKit.h>
  14. #import "NSImage+PDFListView.h"
  15. #import "CPDFListViewConfig.h"
  16. #if VERSION_DMG
  17. #import <PDF_Master-Swift.h>
  18. #else
  19. #import <PDF_Master-Swift.h>
  20. #endif
  21. @implementation ComPDFUIConfig
  22. + (void)initializeUIConfig {
  23. NSURL *initialUserDefaultsURL = [[NSBundle mainBundle] URLForResource:@"InitialUserDefaults" withExtension:@"plist"];
  24. NSDictionary *initialUserDefaultsDict = [NSDictionary dictionaryWithContentsOfURL:initialUserDefaultsURL];
  25. NSDictionary *initialValuesDict = [initialUserDefaultsDict objectForKey:@"RegisteredDefaults"];
  26. // set them in the standard user defaults
  27. [[NSUserDefaults standardUserDefaults] registerDefaults:initialValuesDict];
  28. // App 启动 恢复部分设置
  29. [[KMPreferenceManager shared] resumeDataToPDFView];
  30. [[NSUserDefaults standardUserDefaults] setPDFListViewColor:[NSColor blackColor] forKey:CFreeTextNoteFontColorKey];
  31. [NSImage makePDFListViewCursorImages];
  32. [CPDFListViewConfig defaultManager].annotationBorderOffset = @2;
  33. [CPDFListViewConfig defaultManager].annotationBorderColor = [NSColor colorWithRed:23.0/255.0 green:112.0/255.0 blue:244.0/255.0 alpha:1.0];
  34. [[CPDFKitConfig sharedInstance] setIsShowFormRequiredFlagColor:NO];
  35. [CPDFListViewConfig defaultManager].isSaveDefault = YES;
  36. }
  37. @end