123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- import Cocoa
- class KMPrintBottomView: KMBaseXibView {
- @IBOutlet weak var printerButton: NSButton!
-
- @IBOutlet weak var savePDFButton: NSButton!
-
- @IBOutlet weak var cancelButton: NSButton!
- @IBOutlet weak var printButton: NSButton!
- var delegate: KMPrintBottomViewDelegate?
-
-
- deinit {
- }
- override func draw(_ dirtyRect: NSRect) {
- super.draw(dirtyRect)
-
-
- }
-
- override func setup() {
- super.setup()
-
- self.printerButton.wantsLayer = true
- self.printerButton.layer?.borderWidth = 1
- self.printerButton.layer?.borderColor = NSColor(hex: "#DFE1E5").cgColor
- self.printerButton.layer?.cornerRadius = 4
- self.printerButton.title = NSLocalizedString("Printer", comment: "")
- self.printerButton.font = NSFont.SFProTextRegular(14)
- self.printerButton.contentTintColor = NSColor(hex: "#252629")
-
- self.cancelButton.wantsLayer = true
- self.cancelButton.layer?.borderWidth = 1
- self.cancelButton.layer?.borderColor = NSColor(hex: "#DFE1E5").cgColor
- self.cancelButton.layer?.cornerRadius = 4
- self.cancelButton.title = NSLocalizedString("Cancel", comment: "")
- self.cancelButton.font = NSFont.SFProTextRegular(14)
- self.cancelButton.contentTintColor = NSColor(hex: "#252629")
-
- self.savePDFButton.wantsLayer = true
- self.savePDFButton.layer?.borderWidth = 1
- self.savePDFButton.layer?.borderColor = NSColor(hex: "#DFE1E5").cgColor
- self.savePDFButton.layer?.cornerRadius = 4
- self.savePDFButton.title = NSLocalizedString("Save as PDF", comment: "")
- self.savePDFButton.font = NSFont.SFProTextRegular(14)
- self.savePDFButton.contentTintColor = NSColor(hex: "#252629")
-
- self.printButton.wantsLayer = true
- self.printButton.layer?.backgroundColor = NSColor(hex: "#1770F4").cgColor
- self.printButton.layer?.cornerRadius = 4
- self.printButton.title = NSLocalizedString("Printer", comment: "")
- self.printButton.font = NSFont.SFProTextRegular(14)
- self.printButton.contentTintColor = NSColor(hex: "#FFFFFF")
- }
-
-
- override func reloadData() {
- super.reloadData()
- }
-
-
-
- @IBAction func printerAction(_ sender: Any) {
- if self.delegate != nil {
- self.delegate?.printerAction()
- }
- }
-
- @IBAction func cancelAction(_ sender: Any) {
- if self.delegate != nil {
- self.delegate?.cancelAction()
- }
- }
-
- @IBAction func printAction(_ sender: Any) {
- if self.delegate != nil {
- self.delegate?.printAction()
- }
- }
-
- @IBAction func savePDFAction(_ sender: Any) {
- if self.delegate != nil {
- self.delegate?.savePDFAction()
- }
- }
- }
- protocol KMPrintBottomViewDelegate {
- func printerAction()
- func cancelAction()
- func printAction()
- func savePDFAction()
- }
|