123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- //
- // AccountLogoutWindowController.swift
- // PDF Reader Pro
- //
- // Created by User-Tangchao on 2024/10/31.
- //
- import Cocoa
- class AccountLogoutWindowController: NSWindowController {
- @IBOutlet weak var titleLabel: NSTextField!
- @IBOutlet weak var cancelButton: NSButton!
- @IBOutlet weak var okButton: NSButton!
-
- var itemClick: KMCommonClickBlock?
-
- convenience init() {
- self.init(windowNibName: "AccountLogoutWindowController")
- }
-
- 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 = .white
- self.window?.contentView?.layer?.cornerRadius = 8
- self.window?.contentView?.layer?.borderWidth = 0
- self.window?.contentView?.layer?.borderColor = KMAppearance.themeColor().cgColor
-
- self.titleLabel.stringValue = NSLocalizedString("Are you sure you want to log out?", comment: "")
- self.titleLabel.font = .systemFont(ofSize: 16)
-
- self.cancelButton.title = NSLocalizedString("Cancel", 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("Yes", 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)
- }
- }
|