fix: use native close-only window decorations for notes

This commit is contained in:
2026-10-19 17:40:41 +02:00
parent adac0723a1
commit 2e4a791f29
5 changed files with 77 additions and 22 deletions
@@ -76,6 +76,8 @@ final class LauncherWindowController: NSWindowController, NSWindowDelegate, NSSe
defer: false
)
window.title = "Conjure"
window.titleVisibility = .hidden
window.titlebarAppearsTransparent = true
window.animationBehavior = .none
window.appearance = NSAppearance(named: .darkAqua)
window.backgroundColor = .clear
@@ -238,6 +240,11 @@ final class LauncherWindowController: NSWindowController, NSWindowDelegate, NSSe
alignmentGuides?.update(for: window)
}
func windowShouldClose(_ sender: NSWindow) -> Bool {
dismiss()
return false
}
func windowDidResignKey(_ notification: Notification) {
(window as? LauncherPanel)?.resetNumberHints()
guard !isLaunching, launcherFrameBeforeReview == nil, window?.attachedSheet == nil else { return }
@@ -907,6 +914,7 @@ final class LauncherWindowController: NSWindowController, NSWindowDelegate, NSSe
self.launcherViews.first?.isHidden = false
self.launcherViews.first?.setAccessibilityHidden(false)
if command == .notes, let previousFrame {
self.window?.styleMask = [.borderless]
self.window?.setFrame(previousFrame, display: true)
if let material = content as? NSVisualEffectView { roundMaterialCorners(material, radius: 24) }
}
@@ -945,6 +953,9 @@ final class LauncherWindowController: NSWindowController, NSWindowDelegate, NSSe
)
searchField.setAccessibilityLabel(accessibilityLabel)
if command == .notes {
window?.styleMask = [.titled, .closable, .fullSizeContentView]
window?.standardWindowButton(.miniaturizeButton)?.isHidden = true
window?.standardWindowButton(.zoomButton)?.isHidden = true
launcherViews.first?.isHidden = true
launcherViews.first?.setAccessibilityHidden(true)
if var frame = window?.frame {