KMRepeatVerifyExpireController.m 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. //
  2. // KMRepeatVerifyExpireController.m
  3. // PDF Reader Pro Edition
  4. //
  5. // Created by Niehaoyu on 2023/9/13.
  6. //
  7. #import "KMRepeatVerifyExpireController.h"
  8. #import <PDF_Reader_Pro-Swift.h>
  9. @interface KMRepeatVerifyExpireController ()
  10. @property (assign) IBOutlet NSView *contendView;
  11. @property (assign) IBOutlet NSTextField *titleLbl;
  12. @property (assign) IBOutlet NSTextField *subTitleLbl;
  13. @property (assign) IBOutlet KMCustomButton *enterLicenseBtn;
  14. @property (assign) IBOutlet KMCustomButton *purchaseBtn;
  15. @property (assign) IBOutlet KMCustomButton *laterBtn;
  16. @property (assign) IBOutlet NSView *seplineView;
  17. @property (assign) IBOutlet NSView *descriptionBGView;
  18. @property (assign) IBOutlet NSTextField *convertLbl;
  19. @property (assign) IBOutlet NSTextField *editLbl;
  20. @property (assign) IBOutlet NSTextField *ocrTipLbl;
  21. @property (assign) IBOutlet NSTextField *formfillLbl;
  22. @end
  23. @implementation KMRepeatVerifyExpireController
  24. - (instancetype)init {
  25. if (self = [super initWithNibName:@"KMRepeatVerifyExpireController" bundle:nil]) {
  26. }
  27. return self;
  28. }
  29. - (void)dealloc {
  30. }
  31. #pragma mark Setter Methods
  32. - (void)loadView {
  33. [super loadView];
  34. }
  35. - (void)viewDidLoad {
  36. [super viewDidLoad];
  37. // Do view setup here.
  38. self.contendView.wantsLayer = YES;
  39. self.laterBtn.wantsLayer = self.purchaseBtn.wantsLayer = self.enterLicenseBtn.wantsLayer = YES;
  40. self.laterBtn.layer.cornerRadius = self.purchaseBtn.layer.cornerRadius = self.enterLicenseBtn.layer.cornerRadius = 1.;
  41. self.laterBtn.layer.masksToBounds = self.purchaseBtn.layer.masksToBounds = self.enterLicenseBtn.layer.masksToBounds = YES;
  42. self.descriptionBGView.wantsLayer = YES;
  43. self.descriptionBGView.layer.cornerRadius = 6.;
  44. self.descriptionBGView.layer.masksToBounds = YES;
  45. self.descriptionBGView.layer.borderWidth = 1;
  46. self.seplineView.wantsLayer = YES;
  47. self.titleLbl.stringValue = NSLocalizedString(@"Your Trial Has Expired", nil);
  48. self.subTitleLbl.stringValue = NSLocalizedString(@"Please upgrade PDF Reader Pro to enjoy all features.", nil);
  49. self.enterLicenseBtn.title = NSLocalizedString(@"Enter License", nil);
  50. self.laterBtn.title = NSLocalizedString(@"Later", nil);
  51. self.purchaseBtn.title = NSLocalizedString(@"Buy Now", nil);
  52. self.convertLbl.stringValue = NSLocalizedString(@"Convert PDF to Word/Excel/PPT/Image and more", nil);
  53. self.editLbl.stringValue = NSLocalizedString(@"Edit PDF text, images and pages", nil);
  54. self.ocrTipLbl.stringValue = NSLocalizedString(@"Combine multiple PDFs", nil);
  55. self.formfillLbl.stringValue = NSLocalizedString(@"Create, fill, and sign PDF forms", nil);
  56. [self updateViewColor];
  57. }
  58. - (void)updateViewColor {
  59. if ([KMAppearance isDarkMode]) {
  60. self.contendView.layer.backgroundColor = [NSColor colorWithRed:43/255. green:43/255. blue:43/255. alpha:1.].CGColor;
  61. self.descriptionBGView.layer.backgroundColor = [NSColor colorWithRed:40/255. green:40/255. blue:40/255. alpha:1.].CGColor;
  62. self.descriptionBGView.layer.borderColor = [NSColor colorWithRed:1 green:1 blue:1 alpha:0.05].CGColor;
  63. self.seplineView.layer.backgroundColor = [NSColor colorWithRed:1 green:1 blue:1 alpha:0.1].CGColor;
  64. self.enterLicenseBtn.layer.backgroundColor = [NSColor colorWithRed:86/255. green:88/255. blue:90/255. alpha:1.].CGColor;
  65. self.laterBtn.layer.backgroundColor = [NSColor colorWithRed:86/255. green:88/255. blue:90/255. alpha:1.].CGColor;
  66. self.purchaseBtn.layer.backgroundColor = [NSColor colorWithRed:78/255. green:127/255. blue:219/255. alpha:1.].CGColor;
  67. } else {
  68. self.contendView.layer.backgroundColor = [NSColor colorWithRed:255/255. green:255/255. blue:255/255. alpha:1.].CGColor;
  69. self.descriptionBGView.layer.backgroundColor = [NSColor colorWithRed:246/255. green:246/255. blue:246/255. alpha:1.].CGColor;
  70. self.descriptionBGView.layer.borderColor = [NSColor colorWithRed:0 green:0 blue:0 alpha:0.05].CGColor;
  71. self.seplineView.layer.backgroundColor = [NSColor colorWithRed:0 green:0 blue:0 alpha:0.1].CGColor;
  72. self.enterLicenseBtn.layer.backgroundColor = [NSColor colorWithRed:218/255. green:219/255. blue:222/255. alpha:1.].CGColor;
  73. self.laterBtn.layer.backgroundColor = [NSColor colorWithRed:218/255. green:219/255. blue:222/255. alpha:1.].CGColor;
  74. self.purchaseBtn.layer.backgroundColor = [NSColor colorWithRed:39/255. green:60/255. blue:99/255. alpha:1.].CGColor;
  75. }
  76. [self.enterLicenseBtn setTitleColor:[KMAppearance KMColor_Layout_H0]];
  77. [self.laterBtn setTitleColor:[KMAppearance KMColor_Layout_H0]];
  78. [self.purchaseBtn setTitleColor:[KMAppearance KMColor_Layout_W0]];
  79. }
  80. - (IBAction)btnAction:(KMCustomButton *)sender {
  81. if ([sender isEqual:self.enterLicenseBtn]) {
  82. if (self.callback) {
  83. self.callback(0, self);
  84. }
  85. } else if ([sender isEqual:self.laterBtn]) {
  86. if (self.callback) {
  87. self.callback(1, self);
  88. }
  89. } else if ([sender isEqual:self.purchaseBtn]) {
  90. if (self.callback) {
  91. self.callback(2, self);
  92. }
  93. }
  94. }
  95. @end