12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- //
- // AccountUnsubscribeWindowController.swift
- // PDF Reader Pro
- //
- // Created by User-Tangchao on 2024/10/31.
- //
- import Cocoa
- class AccountUnsubscribeWindowController: NSWindowController {
- @IBOutlet weak var contentBox: NSBox!
- @IBOutlet weak var iconIv: NSImageView!
- @IBOutlet weak var titleLabel: NSTextField!
- @IBOutlet weak var despLabel: NSTextField!
- @IBOutlet weak var cancelButton: NSButton!
- @IBOutlet weak var okButton: NSButton!
-
- var itemClick: KMCommonClickBlock?
-
- convenience init() {
- self.init(windowNibName: "AccountUnsubscribeWindowController")
- }
-
- override func windowDidLoad() {
- super.windowDidLoad()
- // Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
-
- self.window?.appearance = NSAppearance(named: .aqua)
-
- self.window?.backgroundColor = .clear
- self.window?.contentView?.wantsLayer = true
- self.window?.contentView?.layer?.backgroundColor = .clear
- // self.window?.contentView?.layer?.cornerRadius = 8
- // self.window?.contentView?.layer?.borderWidth = 1
- // self.window?.contentView?.layer?.borderColor = KMAppearance.themeColor().cgColor
-
- self.contentBox.borderWidth = 0
- self.contentBox.cornerRadius = 8
- self.contentBox.fillColor = .white
-
- self.iconIv.image = NSImage(named: "KMImageNameAccountUnSubcribeIcon")
- self.titleLabel.stringValue = NSLocalizedString("Are you sure you want to unsubscribe?", comment: "")
- self.titleLabel.font = .systemFont(ofSize: 16)
-
- self.despLabel.stringValue = NSLocalizedString("After canceling the subscription window, you will not be able toenjoy the membership benefits and VIP services provided by theproduct from the next cycle.", comment: "")
- self.despLabel.textColor = NSColor(hex: "#666666")
-
- self.cancelButton.title = NSLocalizedString("I'm Sure", comment: "")
- self.cancelButton.setTitleColor(KMAppearance.themeColor())
- self.cancelButton.wantsLayer = true
- self.cancelButton.layer?.cornerRadius = 4
- self.cancelButton.layer?.borderWidth = 1
- self.cancelButton.layer?.borderColor = KMAppearance.themeColor().cgColor
- self.cancelButton.target = self
- self.cancelButton.action = #selector(cancelAction)
-
- self.okButton.title = NSLocalizedString("I‘ll think about it", comment: "")
- self.okButton.setTitleColor(.white)
- self.okButton.wantsLayer = true
- self.okButton.layer?.cornerRadius = 4
- self.okButton.layer?.backgroundColor = KMAppearance.themeColor().cgColor
- self.okButton.target = self
- self.okButton.action = #selector(okAction)
- }
-
- @objc func cancelAction() {
- self.itemClick?(1)
- }
-
- @objc func okAction() {
- self.itemClick?(2)
- }
-
- }
|