diff --git a/Config.xcconfig b/Config.xcconfig index abe7522..daf3a35 100644 --- a/Config.xcconfig +++ b/Config.xcconfig @@ -5,7 +5,7 @@ // Created by neon443 on 26/05/2025. // -VERSION = 1.2.1 +VERSION = 1.3 BUILD_ID = 3 TEAM_ID = 8JGND254B7 BUNDLE_ID = com.neon443.DockPhobia diff --git a/DockPhobia.xcodeproj/project.pbxproj b/DockPhobia.xcodeproj/project.pbxproj index 77315ec..1d474a3 100644 --- a/DockPhobia.xcodeproj/project.pbxproj +++ b/DockPhobia.xcodeproj/project.pbxproj @@ -14,8 +14,9 @@ A98C20C62DE614180008D61C /* DPSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = A98C20C52DE614180008D61C /* DPSettings.swift */; }; A9C9AF812DE7776A0039D7A5 /* DockSide.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C9AF802DE777530039D7A5 /* DockSide.swift */; }; A9C9AF832DE77CB70039D7A5 /* SkyHigh.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C9AF822DE77CB70039D7A5 /* SkyHigh.swift */; }; - A9C9B0682DE888B20039D7A5 /* Preferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C9B0672DE888B20039D7A5 /* Preferences.swift */; }; A9C9B06D2DE99E5F0039D7A5 /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = A9C9B06C2DE99E5F0039D7A5 /* Sparkle */; }; + A9C9B0712DE9F6E60039D7A5 /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9C9B0702DE9F6E60039D7A5 /* Preferences.xib */; }; + A9C9B0732DE9F7020039D7A5 /* SettingsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C9B0722DE9F7020039D7A5 /* SettingsController.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -29,8 +30,9 @@ A98C20C52DE614180008D61C /* DPSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DPSettings.swift; sourceTree = ""; }; A9C9AF802DE777530039D7A5 /* DockSide.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DockSide.swift; sourceTree = ""; }; A9C9AF822DE77CB70039D7A5 /* SkyHigh.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SkyHigh.swift; sourceTree = ""; }; - A9C9B0672DE888B20039D7A5 /* Preferences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Preferences.swift; sourceTree = ""; }; A9C9B06E2DE9B55F0039D7A5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; + A9C9B0702DE9F6E60039D7A5 /* Preferences.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Preferences.xib; sourceTree = ""; }; + A9C9B0722DE9F7020039D7A5 /* SettingsController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsController.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -56,8 +58,8 @@ A94BEC102DE23ECE00D4811D /* Views */ = { isa = PBXGroup; children = ( + A9C9B0702DE9F6E60039D7A5 /* Preferences.xib */, A94BEC0E2DE23E8500D4811D /* MainMenu.xib */, - A9C9B0672DE888B20039D7A5 /* Preferences.swift */, ); path = Views; sourceTree = ""; @@ -88,6 +90,7 @@ A9C9AF822DE77CB70039D7A5 /* SkyHigh.swift */, A98C20C52DE614180008D61C /* DPSettings.swift */, A9C9AF802DE777530039D7A5 /* DockSide.swift */, + A9C9B0722DE9F7020039D7A5 /* SettingsController.swift */, A94BEC102DE23ECE00D4811D /* Views */, A94BEC0A2DE21F8100D4811D /* Resources */, A966B4F02DE0842400C721A5 /* DockPhobia.entitlements */, @@ -160,6 +163,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + A9C9B0712DE9F6E60039D7A5 /* Preferences.xib in Resources */, A94BEC0F2DE23E8500D4811D /* MainMenu.xib in Resources */, A966B4F52DE0842500C721A5 /* Assets.xcassets in Resources */, ); @@ -174,7 +178,7 @@ files = ( A98C20C62DE614180008D61C /* DPSettings.swift in Sources */, A9C9AF832DE77CB70039D7A5 /* SkyHigh.swift in Sources */, - A9C9B0682DE888B20039D7A5 /* Preferences.swift in Sources */, + A9C9B0732DE9F7020039D7A5 /* SettingsController.swift in Sources */, A966B4F82DE0852900C721A5 /* MouseTracker.swift in Sources */, A966B4F42DE0842500C721A5 /* AppDelegate.swift in Sources */, A9C9AF812DE7776A0039D7A5 /* DockSide.swift in Sources */, diff --git a/DockPhobia/.DS_Store b/DockPhobia/.DS_Store index a92bc56..18996b3 100644 Binary files a/DockPhobia/.DS_Store and b/DockPhobia/.DS_Store differ diff --git a/DockPhobia/AppDelegate.swift b/DockPhobia/AppDelegate.swift index abfe2e2..847e8e9 100644 --- a/DockPhobia/AppDelegate.swift +++ b/DockPhobia/AppDelegate.swift @@ -12,6 +12,7 @@ import Sparkle class AppDelegate: NSObject, NSApplicationDelegate { public var statusItem: NSStatusItem! + public var prefsWindow: NSWindowController? var settings = DPSettingsModel() var mouseTracker: MouseTracker @@ -113,6 +114,13 @@ class AppDelegate: NSObject, NSApplicationDelegate { keyEquivalent: "")) menu.addItem(NSMenuItem.separator()) + let prefs = NSMenuItem( + title: "Preferences", + action: #selector(tappedPrefs), + keyEquivalent: "," + ) + menu.addItem(prefs) + let quit = NSMenuItem(title: "Quit", action: #selector(quit), keyEquivalent: "q") menu.addItem(quit) statusItem.menu = menu @@ -126,6 +134,13 @@ class AppDelegate: NSObject, NSApplicationDelegate { button.image = NSImage(named: "cursor.slash") } } + @objc func tappedPrefs() { + if prefsWindow == nil { + prefsWindow = DPPreferencesWindowController() + } + prefsWindow!.showWindow(nil) + prefsWindow!.window?.orderFront(nil) + } @objc func didTapStart() { if mouseTracker.running { mouseTracker.stop() diff --git a/DockPhobia/SettingsController.swift b/DockPhobia/SettingsController.swift new file mode 100644 index 0000000..961ce01 --- /dev/null +++ b/DockPhobia/SettingsController.swift @@ -0,0 +1,26 @@ +// +// Preferences.swift +// DockPhobia +// +// Created by neon443 on 29/05/2025. +// + +import Foundation +import AppKit +import Sparkle + +class DPPreferencesWindowController: NSWindowController { + @IBOutlet weak var updateCheckButton: NSButton! + + override init(window: NSWindow?) { + super.init(window: window) + } + + required init?(coder: NSCoder) { + super.init(coder: coder) + } + + convenience init() { + self.init(windowNibName: "Preferences") + } +} diff --git a/DockPhobia/Views/Preferences.swift b/DockPhobia/Views/Preferences.swift deleted file mode 100644 index 48b6eb6..0000000 --- a/DockPhobia/Views/Preferences.swift +++ /dev/null @@ -1,8 +0,0 @@ -// -// Preferences.swift -// DockPhobia -// -// Created by neon443 on 29/05/2025. -// - -import Foundation diff --git a/DockPhobia/Views/Preferences.xib b/DockPhobia/Views/Preferences.xib new file mode 100644 index 0000000..1c4590f --- /dev/null +++ b/DockPhobia/Views/Preferences.xib @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +