12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- //
- // KMPageEditPopViewController.m
- // PDF Reader Pro Edition
- //
- // Created by 丁林圭 on 2019/12/24.
- //
- #import "KMPageEditPopViewController.h"
- #import <PDF_Reader_Pro-Swift.h>
- @interface KMPageEditPopViewController ()
- @property (nonatomic,assign) IBOutlet NSTextField *titleLabel;
- @property (nonatomic,assign) IBOutlet NSTextField *titlesubLabel;
- @end
- @implementation KMPageEditPopViewController
- + (BOOL)showPageEditDetails
- {
- BOOL isOpenConvertDetails = [[NSUserDefaults standardUserDefaults] boolForKey:@"KMPageEditHaveOpenConvertDetails"];
- if (!isOpenConvertDetails) {
- [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"KMPageEditHaveOpenConvertDetails"];
- [[NSUserDefaults standardUserDefaults] synchronize];
- return YES;
- }
- return NO;
- }
- - (void)viewDidLoad {
- [super viewDidLoad];
-
- self.view.wantsLayer = YES;
-
- [self updateViewColor];
- self.titleLabel.stringValue = NSLocalizedString(@"The Best PDF Editor", nil);
- self.titlesubLabel.stringValue = NSLocalizedString(@"It’s super simple to organize your PDF file into a professional-looking document. Insert, replace, extract, split, rotate, copy, delete, rearrange PDF pages and organize those pages just the way you like it, all in a matter of seconds. Drag-and-drop makes it more efficient.", nil);
- [NSDistributedNotificationCenter.defaultCenter addObserver:self selector:@selector(themeChanged:) name:@"AppleInterfaceThemeChangedNotification" object: nil];
- }
- - (void)themeChanged:(NSNotification *)notification {
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
- [self updateViewColor];
- });
- }
- #pragma mark - DarkMode
- - (void)updateViewColor {
- if([KMAppearance isDarkMode]){
- self.view.layer.backgroundColor = [NSColor colorWithRed:0.133 green:0.478 blue:1.000 alpha:1].CGColor;
- } else {
- self.view.layer.backgroundColor = [NSColor colorWithRed:0.286 green:0.510 blue:0.902 alpha:1].CGColor;
- }
- }
- - (void)dealloc {
- [[NSNotificationCenter defaultCenter]removeObserver:self];
- // [super dealloc];
- }
- @end
|