KMSnapshotViewController.swift 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //
  2. // KMSnapshotViewController.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by Niehaoyu on 7/18/24.
  6. //
  7. import Cocoa
  8. class KMSnapshotViewController: NSViewController {
  9. @IBOutlet weak var snapshotNormalView: NSView!
  10. @IBOutlet weak var snapshotLabel: NSTextField!
  11. @IBOutlet weak var snapshotNormalMoreButton: NSButton!
  12. @IBOutlet weak var snapshotNormalSearchButton: NSButton!
  13. @IBOutlet weak var snapshotNormalZoomOutButton: NSButton!
  14. @IBOutlet weak var snapshotNormalZoomInButton: NSButton!
  15. @IBOutlet weak var snapshotSearchField: KMLeftSideViewSearchField!
  16. @IBOutlet weak var snapshotDoneButton: NSButton!
  17. @IBOutlet var snapshotTableView: KMBotaTableView!
  18. @IBOutlet var emptySnapView: NSView!
  19. @IBOutlet weak var emptySnapLabel: NSTextField!
  20. @IBOutlet weak var snapshotNotCreatedLabel: NSTextField!
  21. override func viewDidLoad() {
  22. super.viewDidLoad()
  23. // Do view setup here.
  24. self.snapshotNormalView.wantsLayer = true
  25. if(KMAppearance.isDarkMode()){
  26. self.snapshotNormalView.layer?.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1).cgColor
  27. } else {
  28. self.snapshotNormalView.layer?.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1, alpha: 1).cgColor
  29. }
  30. self.emptySnapView.wantsLayer = true
  31. self.emptySnapView.layer?.backgroundColor = .clear
  32. self.emptySnapLabel.stringValue = KMLocalizedString("To create snapshot select an area in contents, right click it and select \"Snapshot\" .",nil)
  33. self.emptySnapLabel.textColor = KMAppearance.Layout.h2Color()
  34. self.snapshotNotCreatedLabel.stringValue = KMLocalizedString("No Snapshots", nil)
  35. self.snapshotNotCreatedLabel.textColor = KMAppearance.Layout.h0Color()
  36. }
  37. func snapshot_initDefalutValue() {
  38. self.snapshotLabel.stringValue = KMLocalizedString("Snapshots", nil)
  39. self.snapshotLabel.textColor = KMAppearance.Layout.h0Color()
  40. self.snapshotNormalSearchButton.toolTip = KMLocalizedString("Search", nil)
  41. self.snapshotSearchField.backgroundColor = KMAppearance.Layout.l_1Color()
  42. self.snapshotSearchField.wantsLayer = true
  43. self.snapshotSearchField.layer?.backgroundColor = KMAppearance.Layout.l_1Color().cgColor
  44. self.snapshotSearchField.layer?.borderWidth = 1.0
  45. self.snapshotSearchField.layer?.borderColor = KMAppearance.Interactive.a0Color().cgColor
  46. self.snapshotDoneButton.toolTip = KMLocalizedString("Done", nil)
  47. self.snapshotDoneButton.wantsLayer = true
  48. self.snapshotDoneButton.layer?.backgroundColor = KMAppearance.Interactive.a0Color().cgColor
  49. self.snapshotDoneButton.layer?.cornerRadius = 4.0
  50. self.snapshotDoneButton.title = KMLocalizedString("Done", nil)
  51. self.snapshotDoneButton.setTitleColor(KMAppearance.Layout.w0Color())
  52. self.snapshotDoneButton.isHidden = true
  53. self.snapshotSearchField.isHidden = true
  54. self.snapshotNormalZoomInButton.toolTip = KMLocalizedString("Zoom In", nil)
  55. self.snapshotNormalZoomOutButton.toolTip = KMLocalizedString("Zoom Out", nil)
  56. }
  57. }