1234567891011121314151617181920212223242526272829303132333435363738 |
- //
- // KMBrowserWindow.swift
- // PDF Reader Pro
- //
- // Created by tangchao on 2024/4/1.
- //
- import Cocoa
- class KMBrowserWindow: CTBrowserWindow {
- override func sendEvent(_ event: NSEvent) {
- if event.type == .leftMouseDown || event.type == .rightMouseDown || event.type == .keyDown {
- KMImageToolTipWindow.shared.orderOut(nil)
- }
- super.sendEvent(event)
- }
-
- override func resignMain() {
- KMImageToolTipWindow.shared.orderOut(nil)
-
- super.resignMain()
- }
-
- override func resignKey() {
- KMImageToolTipWindow.shared.orderOut(nil)
-
- super.resignKey()
- }
-
- override func miniaturize(_ sender: Any?) {
- super.miniaturize(sender)
-
- if let browser = (self.windowController as? KMBrowserWindowController)?.browser {
- let document = browser.activeTabContents() as? KMMainDocument
- document?.mainViewController?.hideMeasureFloatingWindows()
- }
- }
- }
|