Skip to content

Commit 89eca0e

Browse files
committed
Make reason window borderless
1 parent 8936fb3 commit 89eca0e

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

SupportCompanion/ViewModels/ReasonInputManager.swift

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,22 @@ class ReasonInputManager {
2121

2222
let hostingController = NSHostingController(rootView: reasonInputView)
2323

24-
let newWindow = NSWindow(
24+
let newWindow = CustomWindow(
2525
contentRect: NSRect(x: 0, y: 0, width: 550, height: 350),
26-
styleMask: [.titled, .closable],
26+
styleMask: [.borderless],
2727
backing: .buffered,
2828
defer: false
2929
)
30-
30+
newWindow.backgroundColor = .clear
31+
newWindow.isOpaque = false
3132
newWindow.contentView = hostingController.view
32-
newWindow.title = ""
33-
newWindow.styleMask = [.titled, .fullSizeContentView]
33+
newWindow.hasShadow = false
3434
newWindow.center()
35+
newWindow.ignoresMouseEvents = false
36+
newWindow.isMovableByWindowBackground = true
3537
newWindow.isReleasedWhenClosed = false
3638
newWindow.makeKeyAndOrderFront(nil)
39+
newWindow.makeFirstResponder(hostingController.view)
3740

3841
self.window = newWindow
3942

@@ -65,3 +68,8 @@ private class WindowDelegate: NSObject, NSWindowDelegate {
6568
onClose()
6669
}
6770
}
71+
72+
private class CustomWindow: NSWindow {
73+
override var canBecomeKey: Bool { true }
74+
override var canBecomeMain: Bool { true }
75+
}

SupportCompanion/Views/ReasonInput.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,5 @@ struct ReasonInputView: View {
5555
.frame(width: 550, height: 350)
5656
.background(Color(NSColor.windowBackgroundColor))
5757
.cornerRadius(12)
58-
.shadow(radius: 10)
5958
}
6059
}

0 commit comments

Comments
 (0)