| | |
| | | panel.isReleasedWhenClosed = false |
| | | panel.contentView = DismissibleHostingView( |
| | | rootView: ContentView(hideOverlay: { [weak self] in |
| | | self?.hideOverlay() |
| | | self?.hideOverlay(force: true) |
| | | }), |
| | | onBackdropTap: { [weak self] in |
| | | self?.hideOverlay() |
| | |
| | | return panel |
| | | } |
| | | |
| | | private func hideOverlay() { |
| | | guard !isInEditMode else { return } |
| | | private func hideOverlay(force: Bool = false) { |
| | | guard force || !isInEditMode else { return } |
| | | overlayWindow?.orderOut(nil) |
| | | if force { |
| | | overlayWindow = nil |
| | | } |
| | | } |
| | | |
| | | // MARK: - Global Hotkey (Shift+Option+Space) |