feat: initialized popup view for the combined modules (#1084)

This commit is contained in:
Serhiy Mytrovtsiy
2023-02-22 20:17:39 +01:00
parent 03c30606cf
commit 2a6c7b1dcd
7 changed files with 127 additions and 17 deletions

View File

@@ -16,12 +16,12 @@ public protocol Popup_p: NSView {
func settings() -> NSView?
}
internal class PopupWindow: NSWindow, NSWindowDelegate {
public class PopupWindow: NSWindow, NSWindowDelegate {
private let viewController: PopupViewController = PopupViewController()
internal var locked: Bool = false
internal var openedBy: widget_t? = nil
init(title: String, view: Popup_p?, visibilityCallback: @escaping (_ state: Bool) -> Void) {
public init(title: String, view: Popup_p?, visibilityCallback: @escaping (_ state: Bool) -> Void) {
self.viewController.setup(title: title, view: view)
super.init(
@@ -51,12 +51,12 @@ internal class PopupWindow: NSWindow, NSWindowDelegate {
self.delegate = self
}
func windowWillMove(_ notification: Notification) {
public func windowWillMove(_ notification: Notification) {
self.viewController.setCloseButton(true)
self.locked = true
}
func windowDidResignKey(_ notification: Notification) {
public func windowDidResignKey(_ notification: Notification) {
if self.locked {
return
}