1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- //
- // KMToolbarConfigWindowController.swift
- // PDF Reader Pro
- //
- // Created by tangchao on 2024/5/28.
- //
- import Cocoa
- class KMToolbarConfigWindowController: NSWindowController {
- deinit {
- KMPrint("KMToolbarConfigWindowController deinit.")
- }
-
- var leftCellIdentifiers: [String]? {
- didSet {
- self.viewC_.model.leftCellIdentifiers = self.leftCellIdentifiers
- }
- }
- var centerCellIdentifiers: [String]? {
- didSet {
- self.viewC_.model.centerCellIdentifiers = self.centerCellIdentifiers
- }
- }
- var rightCellIdentifiers: [String]? {
- didSet {
- self.viewC_.model.rightCellIdentifiers = self.rightCellIdentifiers
- }
- }
-
- var defaultCellIdentifiers: [String]? {
- didSet {
- self.viewC_.model.defaultCellIdentifiers = self.defaultCellIdentifiers
- }
- }
-
- private let viewC_ = KMToolbarConfigViewController()
-
- override var windowNibName: NSNib.Name? {
- return "KMToolbarConfigWindowController"
- }
-
- override func windowDidLoad() {
- super.windowDidLoad()
-
- self.window?.styleMask.insert(.fullSizeContentView)
- self.window?.contentViewController = self.viewC_
-
- self.viewC_.callback = { [unowned self] resp in
- if resp == .OK {
- KMDataManager.toolbar_saveData(self.viewC_.model)
- }
- self.window?.sheetParent?.endSheet(self.window!, returnCode: resp)
- }
- }
- }
|