1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- //
- // KMNBotaBaseViewController.swift
- // PDF Reader Pro
- //
- // Created by User-Tangchao on 2024/11/30.
- //
- import Cocoa
- import KMComponentLibrary
- class KMNBotaBaseViewController: KMNBaseViewController {
- private lazy var searchButton_: ComponentButton = {
- let view = ComponentButton()
- view.properties = ComponentButtonProperty(type: .text_gray, size: .xxs, state: .normal, isDisable: false, onlyIcon: true)
- return view
- }()
-
- private lazy var headerSearchView_: KMNBotaHeaderSearchView? = {
- let view = KMNBotaHeaderSearchView.createFromNib()
- return view
- }()
-
- var searchButton: ComponentButton {
- get {
- return searchButton_
- }
- }
-
- var headerSearchView: KMNBotaHeaderSearchView? {
- get {
- return headerSearchView_
- }
- }
-
- var searchGroupView: ComponentGroup?
- var searchGroupTarget: ComponentButton?
-
- override func viewDidLoad() {
- super.viewDidLoad()
- // Do view setup here.
- }
-
- override func updateUIThemeColor() {
- super.updateUIThemeColor()
-
- KMMainThreadExecute {
- self.headerSearchView?.wantsLayer = true
- self.headerSearchView?.layer?.backgroundColor = KMNColorTools.colorBg_layoutMiddle().cgColor
- self.headerSearchView?.bottomLine.wantsLayer = true
- self.headerSearchView?.bottomLine.layer?.backgroundColor = KMNColorTools.colorPrimary_border1().cgColor
- }
- }
-
- func showHeaderSearch() {
- headerSearchView?.isHidden = false
-
- view.window?.makeFirstResponder(headerSearchView?.input)
- }
-
- func hideHeaderSearch() {
- headerSearchView?.clearInputData()
- headerSearchView?.isHidden = true
- }
- }
|