mirror of
https://github.com/leonboe1/QuickDrop.git
synced 2026-11-22 06:15:59 +00:00
Auto-close qr view
This commit is contained in:
1 parent
4a13fd049f
commit
eeedb06027
2 files changed
+8
-6
No files matched your search
@@ -109,7 +109,7 @@ Gw
|
|||||||
</connections>
|
</connections>
|
||||||
</button>
|
</button>
|
||||||
<customView id="ACO-U2-AZj">
|
<customView id="ACO-U2-AZj">
|
||||||
<rect key="frame" x="0.0" y="51" width="404" height="146"/>
|
<rect key="frame" x="0.0" y="48" width="404" height="146"/>
|
||||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||||
</customView>
|
</customView>
|
||||||
</subviews>
|
</subviews>
|
||||||
|
|||||||
@@ -111,6 +111,9 @@ class ShareViewController: NSViewController, ShareExtensionDelegate{
|
|||||||
}
|
}
|
||||||
|
|
||||||
override func viewWillDisappear() {
|
override func viewWillDisappear() {
|
||||||
|
|
||||||
|
self.qrWindow?.close()
|
||||||
|
|
||||||
if chosenDevice==nil{
|
if chosenDevice==nil{
|
||||||
NearbyConnectionManager.shared.stopDeviceDiscovery()
|
NearbyConnectionManager.shared.stopDeviceDiscovery()
|
||||||
}
|
}
|
||||||
@@ -118,7 +121,10 @@ class ShareViewController: NSViewController, ShareExtensionDelegate{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@IBAction func cancel(_ sender: AnyObject?) {
|
@IBAction func cancel(_ sender: AnyObject?) {
|
||||||
if let device=chosenDevice{
|
|
||||||
|
self.qrWindow?.close()
|
||||||
|
|
||||||
|
if let device=chosenDevice{
|
||||||
NearbyConnectionManager.shared.cancelOutgoingTransfer(id: device.id!)
|
NearbyConnectionManager.shared.cancelOutgoingTransfer(id: device.id!)
|
||||||
}
|
}
|
||||||
let cancelError = NSError(domain: NSCocoaErrorDomain, code: NSUserCancelledError, userInfo: nil)
|
let cancelError = NSError(domain: NSCocoaErrorDomain, code: NSUserCancelledError, userInfo: nil)
|
||||||
@@ -141,10 +147,6 @@ class ShareViewController: NSViewController, ShareExtensionDelegate{
|
|||||||
defer: false
|
defer: false
|
||||||
)
|
)
|
||||||
|
|
||||||
qrWindow?.styleMask.insert(.fullSizeContentView)
|
|
||||||
qrWindow?.titleVisibility = .hidden
|
|
||||||
qrWindow?.titlebarAppearsTransparent = true
|
|
||||||
|
|
||||||
qrWindow?.center()
|
qrWindow?.center()
|
||||||
qrWindow?.isReleasedWhenClosed = false
|
qrWindow?.isReleasedWhenClosed = false
|
||||||
qrWindow?.setFrameAutosaveName("QrCodeScreen")
|
qrWindow?.setFrameAutosaveName("QrCodeScreen")
|
||||||
|
|||||||
Reference in new issue
Block a user