style: anchor launcher-styled actions above the footer

This commit is contained in:
2026-10-12 15:48:13 +02:00
parent 2598f6f1dd
commit eb99269c68
3 changed files with 125 additions and 41 deletions
@@ -53,6 +53,7 @@ final class LauncherWindowController: NSWindowController, NSWindowDelegate, NSSe
}
actions.closed = { [weak self] in
guard let self else { return }
self.openButton.keyEquivalent = "\r"
if NSApp.isActive { self.window?.makeFirstResponder(self.searchField) }
else { self.dismiss(restoringFocus: false) }
}
@@ -143,7 +144,7 @@ final class LauncherWindowController: NSWindowController, NSWindowDelegate, NSSe
}
func windowDidResignKey(_ notification: Notification) {
guard !isLaunching, !actions.isShown, window?.attachedSheet == nil else { return }
guard !isLaunching, window?.attachedSheet == nil else { return }
dismiss(restoringFocus: false)
}
@@ -495,6 +496,7 @@ final class LauncherWindowController: NSWindowController, NSWindowDelegate, NSSe
let application = results[tableView.selectedRow]
actions.uninstall = { [weak self] in self?.reviewUninstall(application) }
actions.show(for: application, relativeTo: actionsButton)
openButton.keyEquivalent = actions.isShown ? "" : "\r"
}
private func reviewUninstall(_ application: Application) {
@@ -613,7 +615,7 @@ final class LauncherRowView: NSTableRowView {
}
@MainActor
private func roundMaterialCorners(_ view: NSVisualEffectView, radius: CGFloat) {
func roundMaterialCorners(_ view: NSVisualEffectView, radius: CGFloat) {
let size = NSSize(width: radius * 2 + 1, height: radius * 2 + 1)
let mask = NSImage(size: size, flipped: false) { rect in
NSColor.black.setFill()