Sin descripción

AppDelegate.swift 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // AppDelegate.swift
  3. // App for Indeed
  4. //
  5. // Created by Mql Mac 2 on 11/05/2026.
  6. //
  7. import Cocoa
  8. @main
  9. class AppDelegate: NSObject, NSApplicationDelegate {
  10. private let minimumWindowSize = NSSize(width: 1024, height: 700)
  11. func applicationWillFinishLaunching(_ notification: Notification) {
  12. // Dashboard is light-themed; without this, a Dark Mode Mac paints a dark title bar.
  13. NSApp.appearance = NSAppearance(named: .aqua)
  14. }
  15. func applicationDidFinishLaunching(_ aNotification: Notification) {
  16. NSApp.activate(ignoringOtherApps: true)
  17. DispatchQueue.main.async { [weak self] in
  18. guard
  19. let self,
  20. let window = NSApp.windows.first
  21. else { return }
  22. window.minSize = self.minimumWindowSize
  23. window.setContentSize(self.minimumWindowSize)
  24. window.title = "App for Indeed"
  25. window.styleMask.insert(.fullSizeContentView)
  26. window.titlebarAppearsTransparent = true
  27. window.titleVisibility = .hidden
  28. window.isMovableByWindowBackground = true
  29. window.center()
  30. window.makeKeyAndOrderFront(nil)
  31. }
  32. }
  33. func applicationWillTerminate(_ aNotification: Notification) {
  34. // Insert code here to tear down your application
  35. }
  36. func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
  37. return true
  38. }
  39. }