Something went wrong. Try again.
An auto tiler for macOS
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132import AppKitimport SwiftUI
final class AccessibilityDragPanel: NSPanel { var onDismiss: (() -> Void)? override var canBecomeKey: Bool { true } override var canBecomeMain: Bool { false }
init(frame: CGRect, bundleURL: URL, onDismiss: @escaping () -> Void) { super.init(contentRect: frame, styleMask: [.borderless, .nonactivatingPanel], backing: .buffered, defer: false) self.onDismiss = onDismiss level = .floating isFloatingPanel = true becomesKeyOnlyIfNeeded = true hidesOnDeactivate = false isReleasedWhenClosed = false isOpaque = false backgroundColor = .clear hasShadow = true collectionBehavior = [.transient, .moveToActiveSpace, .fullScreenAuxiliary] title = UIStrings.text("Drag Parcel into the Accessibility list") let view = NSHostingView(rootView: AccessibilityDragView(bundleURL: bundleURL, onDismiss: onDismiss)) // Settings geometry owns the frame; hosting must not resize the window. view.sizingOptions = [] view.frame = CGRect(origin: .zero, size: frame.size) view.wantsLayer = true contentView = view }
override func cancelOperation(_ sender: Any?) { onDismiss?() }}