1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- //
- // KMSnapshotViewController.swift
- // PDF Reader Pro
- //
- // Created by Niehaoyu on 7/18/24.
- //
- import Cocoa
- class KMSnapshotViewController: NSViewController {
- @IBOutlet weak var snapshotNormalView: NSView!
- @IBOutlet weak var snapshotLabel: NSTextField!
- @IBOutlet weak var snapshotNormalMoreButton: NSButton!
- @IBOutlet weak var snapshotNormalSearchButton: NSButton!
- @IBOutlet weak var snapshotNormalZoomOutButton: NSButton!
- @IBOutlet weak var snapshotNormalZoomInButton: NSButton!
- @IBOutlet weak var snapshotSearchField: KMLeftSideViewSearchField!
- @IBOutlet weak var snapshotDoneButton: NSButton!
-
- @IBOutlet var snapshotTableView: KMBotaTableView!
-
- @IBOutlet var emptySnapView: NSView!
- @IBOutlet weak var emptySnapLabel: NSTextField!
- @IBOutlet weak var snapshotNotCreatedLabel: NSTextField!
- //
- // convenience init(type : KMLeftMethodMode) {
- // self.init()
- //
- // }
-
- override init(nibName nibNameOrNil: NSNib.Name?, bundle nibBundleOrNil: Bundle?) {
- super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
-
- }
-
- required init?(coder: NSCoder) {
- super.init(coder: coder)
- }
-
- override func viewDidLoad() {
- super.viewDidLoad()
- // Do view setup here.
-
-
-
-
- self.snapshotNormalView.wantsLayer = true
- if(KMAppearance.isDarkMode()){
- self.snapshotNormalView.layer?.backgroundColor = NSColor(red: 0.149, green: 0.157, blue: 0.169, alpha: 1).cgColor
- } else {
- self.snapshotNormalView.layer?.backgroundColor = NSColor(red: 0.988, green: 0.992, blue: 1, alpha: 1).cgColor
- }
-
- self.emptySnapView.wantsLayer = true
- self.emptySnapView.layer?.backgroundColor = .clear
- self.emptySnapLabel.stringValue = KMLocalizedString("To create snapshot select an area in contents, right click it and select \"Snapshot\" .",nil)
- self.emptySnapLabel.textColor = KMAppearance.Layout.h2Color()
- self.snapshotNotCreatedLabel.stringValue = KMLocalizedString("No Snapshots", nil)
- self.snapshotNotCreatedLabel.textColor = KMAppearance.Layout.h0Color()
-
- }
-
- func snapshot_initDefalutValue() {
- self.snapshotLabel.stringValue = KMLocalizedString("Snapshots", nil)
- self.snapshotLabel.textColor = KMAppearance.Layout.h0Color()
- self.snapshotNormalSearchButton.toolTip = KMLocalizedString("Search", nil)
-
- self.snapshotSearchField.backgroundColor = KMAppearance.Layout.l_1Color()
- self.snapshotSearchField.wantsLayer = true
- self.snapshotSearchField.layer?.backgroundColor = KMAppearance.Layout.l_1Color().cgColor
- self.snapshotSearchField.layer?.borderWidth = 1.0
- self.snapshotSearchField.layer?.borderColor = KMAppearance.Interactive.a0Color().cgColor
-
- self.snapshotDoneButton.toolTip = KMLocalizedString("Done", nil)
- self.snapshotDoneButton.wantsLayer = true
- self.snapshotDoneButton.layer?.backgroundColor = KMAppearance.Interactive.a0Color().cgColor
- self.snapshotDoneButton.layer?.cornerRadius = 4.0
- self.snapshotDoneButton.title = KMLocalizedString("Done", nil)
- self.snapshotDoneButton.setTitleColor(KMAppearance.Layout.w0Color())
- self.snapshotDoneButton.isHidden = true
-
- self.snapshotSearchField.isHidden = true
-
- self.snapshotNormalZoomInButton.toolTip = KMLocalizedString("Zoom In", nil)
- self.snapshotNormalZoomOutButton.toolTip = KMLocalizedString("Zoom Out", nil)
-
-
- }
-
-
- func reloadData() {
-
- self.snapshotTableView.reloadData()
-
- }
-
- }
|