fix: use native close-only window decorations for notes
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user