mirror of
https://github.com/neon443/DockPhobia.git
synced 2026-03-11 14:56:16 +00:00
Compare commits
7 Commits
58c834f1ed
...
1.3.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a4b0f0f65 | ||
|
|
6c9d65f026 | ||
|
|
4b0e0db186 | ||
|
|
c0b8d2f3ed | ||
|
|
a6f06c4e12 | ||
|
|
9ff4f67e33 | ||
|
|
5bfeef66ab |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
**.DS_Store
|
**.DS_Store
|
||||||
|
**DockPhobia.dmg
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
// Created by neon443 on 26/05/2025.
|
// Created by neon443 on 26/05/2025.
|
||||||
//
|
//
|
||||||
|
|
||||||
VERSION = 1.0.1
|
VERSION = 1.3
|
||||||
BUILD_ID = 2
|
BUILD_ID = 3
|
||||||
TEAM_ID = 8JGND254B7
|
TEAM_ID = 8JGND254B7
|
||||||
BUNDLE_ID = com.neon443.DockPhobia
|
BUNDLE_ID = com.neon443.DockPhobia
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,9 @@
|
|||||||
A98C20C62DE614180008D61C /* DPSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = A98C20C52DE614180008D61C /* DPSettings.swift */; };
|
A98C20C62DE614180008D61C /* DPSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = A98C20C52DE614180008D61C /* DPSettings.swift */; };
|
||||||
A9C9AF812DE7776A0039D7A5 /* DockSide.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C9AF802DE777530039D7A5 /* DockSide.swift */; };
|
A9C9AF812DE7776A0039D7A5 /* DockSide.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C9AF802DE777530039D7A5 /* DockSide.swift */; };
|
||||||
A9C9AF832DE77CB70039D7A5 /* SkyHigh.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C9AF822DE77CB70039D7A5 /* SkyHigh.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 */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXFileReference section */
|
/* Begin PBXFileReference section */
|
||||||
@@ -28,7 +30,9 @@
|
|||||||
A98C20C52DE614180008D61C /* DPSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DPSettings.swift; sourceTree = "<group>"; };
|
A98C20C52DE614180008D61C /* DPSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DPSettings.swift; sourceTree = "<group>"; };
|
||||||
A9C9AF802DE777530039D7A5 /* DockSide.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DockSide.swift; sourceTree = "<group>"; };
|
A9C9AF802DE777530039D7A5 /* DockSide.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DockSide.swift; sourceTree = "<group>"; };
|
||||||
A9C9AF822DE77CB70039D7A5 /* SkyHigh.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SkyHigh.swift; sourceTree = "<group>"; };
|
A9C9AF822DE77CB70039D7A5 /* SkyHigh.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SkyHigh.swift; sourceTree = "<group>"; };
|
||||||
A9C9B0672DE888B20039D7A5 /* Preferences.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Preferences.swift; sourceTree = "<group>"; };
|
A9C9B06E2DE9B55F0039D7A5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||||
|
A9C9B0702DE9F6E60039D7A5 /* Preferences.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = Preferences.xib; sourceTree = "<group>"; };
|
||||||
|
A9C9B0722DE9F7020039D7A5 /* SettingsController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsController.swift; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
@@ -36,6 +40,7 @@
|
|||||||
isa = PBXFrameworksBuildPhase;
|
isa = PBXFrameworksBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
A9C9B06D2DE99E5F0039D7A5 /* Sparkle in Frameworks */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
};
|
};
|
||||||
@@ -53,8 +58,8 @@
|
|||||||
A94BEC102DE23ECE00D4811D /* Views */ = {
|
A94BEC102DE23ECE00D4811D /* Views */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
A9C9B0702DE9F6E60039D7A5 /* Preferences.xib */,
|
||||||
A94BEC0E2DE23E8500D4811D /* MainMenu.xib */,
|
A94BEC0E2DE23E8500D4811D /* MainMenu.xib */,
|
||||||
A9C9B0672DE888B20039D7A5 /* Preferences.swift */,
|
|
||||||
);
|
);
|
||||||
path = Views;
|
path = Views;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -79,11 +84,13 @@
|
|||||||
A966B4F32DE0842400C721A5 /* DockPhobia */ = {
|
A966B4F32DE0842400C721A5 /* DockPhobia */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
A9C9B06E2DE9B55F0039D7A5 /* Info.plist */,
|
||||||
A966B4EE2DE0842400C721A5 /* AppDelegate.swift */,
|
A966B4EE2DE0842400C721A5 /* AppDelegate.swift */,
|
||||||
A966B4F72DE0852900C721A5 /* MouseTracker.swift */,
|
A966B4F72DE0852900C721A5 /* MouseTracker.swift */,
|
||||||
A9C9AF822DE77CB70039D7A5 /* SkyHigh.swift */,
|
A9C9AF822DE77CB70039D7A5 /* SkyHigh.swift */,
|
||||||
A98C20C52DE614180008D61C /* DPSettings.swift */,
|
A98C20C52DE614180008D61C /* DPSettings.swift */,
|
||||||
A9C9AF802DE777530039D7A5 /* DockSide.swift */,
|
A9C9AF802DE777530039D7A5 /* DockSide.swift */,
|
||||||
|
A9C9B0722DE9F7020039D7A5 /* SettingsController.swift */,
|
||||||
A94BEC102DE23ECE00D4811D /* Views */,
|
A94BEC102DE23ECE00D4811D /* Views */,
|
||||||
A94BEC0A2DE21F8100D4811D /* Resources */,
|
A94BEC0A2DE21F8100D4811D /* Resources */,
|
||||||
A966B4F02DE0842400C721A5 /* DockPhobia.entitlements */,
|
A966B4F02DE0842400C721A5 /* DockPhobia.entitlements */,
|
||||||
@@ -108,6 +115,7 @@
|
|||||||
);
|
);
|
||||||
name = DockPhobia;
|
name = DockPhobia;
|
||||||
packageProductDependencies = (
|
packageProductDependencies = (
|
||||||
|
A9C9B06C2DE99E5F0039D7A5 /* Sparkle */,
|
||||||
);
|
);
|
||||||
productName = DockPhobia;
|
productName = DockPhobia;
|
||||||
productReference = A966B4D62DE0841000C721A5 /* DockPhobia.app */;
|
productReference = A966B4D62DE0841000C721A5 /* DockPhobia.app */;
|
||||||
@@ -138,6 +146,9 @@
|
|||||||
);
|
);
|
||||||
mainGroup = A966B4CD2DE0841000C721A5;
|
mainGroup = A966B4CD2DE0841000C721A5;
|
||||||
minimizedProjectReferenceProxies = 1;
|
minimizedProjectReferenceProxies = 1;
|
||||||
|
packageReferences = (
|
||||||
|
A9C9B06B2DE99E5F0039D7A5 /* XCRemoteSwiftPackageReference "Sparkle" */,
|
||||||
|
);
|
||||||
productRefGroup = A966B4D72DE0841000C721A5 /* Products */;
|
productRefGroup = A966B4D72DE0841000C721A5 /* Products */;
|
||||||
projectDirPath = "";
|
projectDirPath = "";
|
||||||
projectRoot = "";
|
projectRoot = "";
|
||||||
@@ -152,6 +163,7 @@
|
|||||||
isa = PBXResourcesBuildPhase;
|
isa = PBXResourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
|
A9C9B0712DE9F6E60039D7A5 /* Preferences.xib in Resources */,
|
||||||
A94BEC0F2DE23E8500D4811D /* MainMenu.xib in Resources */,
|
A94BEC0F2DE23E8500D4811D /* MainMenu.xib in Resources */,
|
||||||
A966B4F52DE0842500C721A5 /* Assets.xcassets in Resources */,
|
A966B4F52DE0842500C721A5 /* Assets.xcassets in Resources */,
|
||||||
);
|
);
|
||||||
@@ -166,7 +178,7 @@
|
|||||||
files = (
|
files = (
|
||||||
A98C20C62DE614180008D61C /* DPSettings.swift in Sources */,
|
A98C20C62DE614180008D61C /* DPSettings.swift in Sources */,
|
||||||
A9C9AF832DE77CB70039D7A5 /* SkyHigh.swift in Sources */,
|
A9C9AF832DE77CB70039D7A5 /* SkyHigh.swift in Sources */,
|
||||||
A9C9B0682DE888B20039D7A5 /* Preferences.swift in Sources */,
|
A9C9B0732DE9F7020039D7A5 /* SettingsController.swift in Sources */,
|
||||||
A966B4F82DE0852900C721A5 /* MouseTracker.swift in Sources */,
|
A966B4F82DE0852900C721A5 /* MouseTracker.swift in Sources */,
|
||||||
A966B4F42DE0842500C721A5 /* AppDelegate.swift in Sources */,
|
A966B4F42DE0842500C721A5 /* AppDelegate.swift in Sources */,
|
||||||
A9C9AF812DE7776A0039D7A5 /* DockSide.swift in Sources */,
|
A9C9AF812DE7776A0039D7A5 /* DockSide.swift in Sources */,
|
||||||
@@ -310,6 +322,7 @@
|
|||||||
ENABLE_HARDENED_RUNTIME = YES;
|
ENABLE_HARDENED_RUNTIME = YES;
|
||||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
INFOPLIST_FILE = DockPhobia/Info.plist;
|
||||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.entertainment";
|
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.entertainment";
|
||||||
INFOPLIST_KEY_LSUIElement = YES;
|
INFOPLIST_KEY_LSUIElement = YES;
|
||||||
INFOPLIST_KEY_NSAppleEventsUsageDescription = _;
|
INFOPLIST_KEY_NSAppleEventsUsageDescription = _;
|
||||||
@@ -345,6 +358,7 @@
|
|||||||
ENABLE_HARDENED_RUNTIME = YES;
|
ENABLE_HARDENED_RUNTIME = YES;
|
||||||
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
INFOPLIST_FILE = DockPhobia/Info.plist;
|
||||||
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.entertainment";
|
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.entertainment";
|
||||||
INFOPLIST_KEY_LSUIElement = YES;
|
INFOPLIST_KEY_LSUIElement = YES;
|
||||||
INFOPLIST_KEY_NSAppleEventsUsageDescription = _;
|
INFOPLIST_KEY_NSAppleEventsUsageDescription = _;
|
||||||
@@ -388,6 +402,25 @@
|
|||||||
defaultConfigurationName = Release;
|
defaultConfigurationName = Release;
|
||||||
};
|
};
|
||||||
/* End XCConfigurationList section */
|
/* End XCConfigurationList section */
|
||||||
|
|
||||||
|
/* Begin XCRemoteSwiftPackageReference section */
|
||||||
|
A9C9B06B2DE99E5F0039D7A5 /* XCRemoteSwiftPackageReference "Sparkle" */ = {
|
||||||
|
isa = XCRemoteSwiftPackageReference;
|
||||||
|
repositoryURL = "https://github.com/sparkle-project/Sparkle";
|
||||||
|
requirement = {
|
||||||
|
kind = upToNextMajorVersion;
|
||||||
|
minimumVersion = 2.7.0;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
/* End XCRemoteSwiftPackageReference section */
|
||||||
|
|
||||||
|
/* Begin XCSwiftPackageProductDependency section */
|
||||||
|
A9C9B06C2DE99E5F0039D7A5 /* Sparkle */ = {
|
||||||
|
isa = XCSwiftPackageProductDependency;
|
||||||
|
package = A9C9B06B2DE99E5F0039D7A5 /* XCRemoteSwiftPackageReference "Sparkle" */;
|
||||||
|
productName = Sparkle;
|
||||||
|
};
|
||||||
|
/* End XCSwiftPackageProductDependency section */
|
||||||
};
|
};
|
||||||
rootObject = A966B4CE2DE0841000C721A5 /* Project object */;
|
rootObject = A966B4CE2DE0841000C721A5 /* Project object */;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"originHash" : "e721da7f9826abdffcb6185e886155efa2514bd6234475f1afa893e29eb258d6",
|
||||||
|
"pins" : [
|
||||||
|
{
|
||||||
|
"identity" : "sparkle",
|
||||||
|
"kind" : "remoteSourceControl",
|
||||||
|
"location" : "https://github.com/sparkle-project/Sparkle",
|
||||||
|
"state" : {
|
||||||
|
"revision" : "0ca3004e98712ea2b39dd881d28448630cce1c99",
|
||||||
|
"version" : "2.7.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version" : 3
|
||||||
|
}
|
||||||
BIN
DockPhobia/.DS_Store
vendored
BIN
DockPhobia/.DS_Store
vendored
Binary file not shown.
@@ -6,17 +6,26 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
import AppKit
|
import AppKit
|
||||||
|
import Sparkle
|
||||||
|
|
||||||
@NSApplicationMain
|
@NSApplicationMain
|
||||||
class AppDelegate: NSObject, NSApplicationDelegate {
|
class AppDelegate: NSObject, NSApplicationDelegate {
|
||||||
|
|
||||||
public var statusItem: NSStatusItem!
|
public var statusItem: NSStatusItem!
|
||||||
|
public var prefsWindow: NSWindowController?
|
||||||
|
|
||||||
var settings = DPSettingsModel()
|
var settings = DPSettingsModel()
|
||||||
var mouseTracker: MouseTracker
|
var mouseTracker: MouseTracker
|
||||||
|
let updateController: SPUStandardUpdaterController
|
||||||
|
|
||||||
override init() {
|
override init() {
|
||||||
self.mouseTracker = MouseTracker(settings: settings)
|
self.mouseTracker = MouseTracker(settings: settings)
|
||||||
|
//call .startUpdater() later
|
||||||
|
updateController = SPUStandardUpdaterController(
|
||||||
|
startingUpdater: true,
|
||||||
|
updaterDelegate: nil,
|
||||||
|
userDriverDelegate: nil
|
||||||
|
)
|
||||||
super.init()
|
super.init()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,13 +51,6 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|||||||
let start = NSMenuItem(title: describeStartButton(), action: #selector(didTapStart), keyEquivalent: "")
|
let start = NSMenuItem(title: describeStartButton(), action: #selector(didTapStart), keyEquivalent: "")
|
||||||
menu.addItem(start)
|
menu.addItem(start)
|
||||||
|
|
||||||
let screen = NSMenuItem(
|
|
||||||
title: "\(mouseTracker.screen.width)x\(mouseTracker.screen.height)",
|
|
||||||
action: nil,
|
|
||||||
keyEquivalent: ""
|
|
||||||
)
|
|
||||||
menu.addItem(screen)
|
|
||||||
|
|
||||||
let dockMoves = NSMenuItem(
|
let dockMoves = NSMenuItem(
|
||||||
title: "Moved the Dock \(settings.settings.dockMoves) time\(settings.settings.dockMoves.plural)",
|
title: "Moved the Dock \(settings.settings.dockMoves) time\(settings.settings.dockMoves.plural)",
|
||||||
action: nil,
|
action: nil,
|
||||||
@@ -74,29 +76,35 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|||||||
|
|
||||||
menu.addItem(NSMenuItem.separator())
|
menu.addItem(NSMenuItem.separator())
|
||||||
|
|
||||||
let checkfullscreenButton = NSMenuItem(
|
|
||||||
title: "Smaller deathzone in fullscreen",
|
|
||||||
action: #selector(checkFullscreenToggle),
|
|
||||||
keyEquivalent: ""
|
|
||||||
)
|
|
||||||
checkfullscreenButton.state = NSControl.StateValue(rawValue: settings.settings.checkFullscreen ? 1 : 0)
|
|
||||||
menu.addItem(checkfullscreenButton)
|
|
||||||
menu.addItem(NSMenuItem.separator())
|
|
||||||
|
|
||||||
menu.addItem(NSMenuItem(
|
menu.addItem(NSMenuItem(
|
||||||
title: "Move Dock to the left",
|
title: "Move Dock to the left",
|
||||||
action: #selector(moveDockObjcLeft),
|
action: #selector(moveDockObjcLeft),
|
||||||
keyEquivalent: ""))
|
keyEquivalent: "1"))
|
||||||
menu.addItem(NSMenuItem(
|
menu.addItem(NSMenuItem(
|
||||||
title: "Move Dock to the bottom",
|
title: "Move Dock to the bottom",
|
||||||
action: #selector(moveDockObjcBottom),
|
action: #selector(moveDockObjcBottom),
|
||||||
keyEquivalent: ""))
|
keyEquivalent: "2"))
|
||||||
menu.addItem(NSMenuItem(
|
menu.addItem(NSMenuItem(
|
||||||
title: "Move Dock to the right",
|
title: "Move Dock to the right",
|
||||||
action: #selector(moveDockObjcRight),
|
action: #selector(moveDockObjcRight),
|
||||||
keyEquivalent: ""))
|
keyEquivalent: "3"))
|
||||||
menu.addItem(NSMenuItem.separator())
|
menu.addItem(NSMenuItem.separator())
|
||||||
|
|
||||||
|
let checkforUpdatesMenuItem = NSMenuItem(
|
||||||
|
title: "Check for Updates...",
|
||||||
|
action: #selector(SPUStandardUpdaterController.checkForUpdates(_:)),
|
||||||
|
keyEquivalent: ""
|
||||||
|
)
|
||||||
|
checkforUpdatesMenuItem.target = updateController
|
||||||
|
menu.addItem(checkforUpdatesMenuItem)
|
||||||
|
|
||||||
|
let prefs = NSMenuItem(
|
||||||
|
title: "Preferences",
|
||||||
|
action: #selector(tappedPrefs),
|
||||||
|
keyEquivalent: ","
|
||||||
|
)
|
||||||
|
menu.addItem(prefs)
|
||||||
|
|
||||||
let quit = NSMenuItem(title: "Quit", action: #selector(quit), keyEquivalent: "q")
|
let quit = NSMenuItem(title: "Quit", action: #selector(quit), keyEquivalent: "q")
|
||||||
menu.addItem(quit)
|
menu.addItem(quit)
|
||||||
statusItem.menu = menu
|
statusItem.menu = menu
|
||||||
@@ -110,6 +118,17 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|||||||
button.image = NSImage(named: "cursor.slash")
|
button.image = NSImage(named: "cursor.slash")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@objc func tappedPrefs() {
|
||||||
|
if prefsWindow == nil {
|
||||||
|
prefsWindow = DPPreferencesWindowController(
|
||||||
|
mouseTracker: mouseTracker,
|
||||||
|
settings: settings,
|
||||||
|
updater: updateController
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
prefsWindow!.window?.orderFront(nil)
|
||||||
|
}
|
||||||
@objc func didTapStart() {
|
@objc func didTapStart() {
|
||||||
if mouseTracker.running {
|
if mouseTracker.running {
|
||||||
mouseTracker.stop()
|
mouseTracker.stop()
|
||||||
|
|||||||
@@ -71,14 +71,14 @@ struct DPSettings: Codable {
|
|||||||
let defaults = DPSettings()
|
let defaults = DPSettings()
|
||||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||||
dockMoves = try container.decodeIfPresent(Int.self, forKey: .dockMoves)
|
dockMoves = try container.decodeIfPresent(Int.self, forKey: .dockMoves)
|
||||||
?? defaults.dockMoves
|
?? defaults.dockMoves
|
||||||
mouseMoves = try container.decodeIfPresent(Int.self, forKey: .mouseMoves)
|
mouseMoves = try container.decodeIfPresent(Int.self, forKey: .mouseMoves)
|
||||||
?? defaults.mouseMoves
|
?? defaults.mouseMoves
|
||||||
|
|
||||||
checkFullscreen = try container.decodeIfPresent(Bool.self, forKey: .checkFullscreen)
|
checkFullscreen = try container.decodeIfPresent(Bool.self, forKey: .checkFullscreen)
|
||||||
?? defaults.checkFullscreen
|
?? defaults.checkFullscreen
|
||||||
moveMouseInstead = try container.decodeIfPresent(Bool.self, forKey: .moveMouseInstead)
|
moveMouseInstead = try container.decodeIfPresent(Bool.self, forKey: .moveMouseInstead)
|
||||||
?? defaults.moveMouseInstead
|
?? defaults.moveMouseInstead
|
||||||
|
|
||||||
insetHorizontal = try container.decodeIfPresent(CGFloat.self, forKey: .insetHorizontal)
|
insetHorizontal = try container.decodeIfPresent(CGFloat.self, forKey: .insetHorizontal)
|
||||||
?? defaults.insetHorizontal
|
?? defaults.insetHorizontal
|
||||||
|
|||||||
12
DockPhobia/Info.plist
Normal file
12
DockPhobia/Info.plist
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>SUFeedURL</key>
|
||||||
|
<string>https://neon443.github.io/appcasts/DockPhobia/appcast.xml</string>
|
||||||
|
<key>SUpublicEDKey</key>
|
||||||
|
<string>ahgIyJGs4MCQ6UXwQ11aknk3a6GwOodHKSmVv4bw6KY=</string>
|
||||||
|
<key>SUEnableAutomaticChecks</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -64,12 +64,12 @@ class MouseTracker {
|
|||||||
|
|
||||||
func checkMouse(_ event: NSEvent) {
|
func checkMouse(_ event: NSEvent) {
|
||||||
let location = event.mouseLocationCG
|
let location = event.mouseLocationCG
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
var cgpointForSkyHigh = NSEvent.mouseLocation
|
var cgpointForSkyHigh = NSEvent.mouseLocation
|
||||||
cgpointForSkyHigh.x -= 20
|
cgpointForSkyHigh.x -= 20
|
||||||
cgpointForSkyHigh.y -= 5
|
cgpointForSkyHigh.y -= 5
|
||||||
skyHigh.move(to: cgpointForSkyHigh)
|
skyHigh.move(to: cgpointForSkyHigh)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
guard settings.settings.checkFullscreen else {
|
guard settings.settings.checkFullscreen else {
|
||||||
handleDockValue(dockIsAt: currentDockSide, location: location)
|
handleDockValue(dockIsAt: currentDockSide, location: location)
|
||||||
@@ -127,12 +127,18 @@ class MouseTracker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func start() {
|
func start() {
|
||||||
|
#if DEBUG
|
||||||
|
skyHigh.show()
|
||||||
|
#endif
|
||||||
self.monitor = NSEvent.addGlobalMonitorForEvents(matching: .mouseMoved, handler: checkMouse)
|
self.monitor = NSEvent.addGlobalMonitorForEvents(matching: .mouseMoved, handler: checkMouse)
|
||||||
self.running = true
|
self.running = true
|
||||||
print("started tracking")
|
print("started tracking")
|
||||||
}
|
}
|
||||||
|
|
||||||
func stop() {
|
func stop() {
|
||||||
|
#if DEBUG
|
||||||
|
skyHigh.hide()
|
||||||
|
#endif
|
||||||
if let monitor = monitor {
|
if let monitor = monitor {
|
||||||
NSEvent.removeMonitor(monitor)
|
NSEvent.removeMonitor(monitor)
|
||||||
self.running = false
|
self.running = false
|
||||||
@@ -177,15 +183,15 @@ class MouseTracker {
|
|||||||
|
|
||||||
func moveDock(_ toSide: DockSide) {
|
func moveDock(_ toSide: DockSide) {
|
||||||
guard currentDockSide != toSide else { return }
|
guard currentDockSide != toSide else { return }
|
||||||
// let scriptHide = """
|
// let scriptHide = """
|
||||||
// tell application "System Events"
|
// tell application "System Events"
|
||||||
// tell dock preferences
|
// tell dock preferences
|
||||||
// set autohide to true
|
// set autohide to true
|
||||||
// end tell
|
// end tell
|
||||||
// end tell
|
// end tell
|
||||||
// """
|
// """
|
||||||
//
|
//
|
||||||
// let scriptShow = scriptHide.replacingOccurrences(of: "true", with: "false")
|
// let scriptShow = scriptHide.replacingOccurrences(of: "true", with: "false")
|
||||||
|
|
||||||
let scriptMove = """
|
let scriptMove = """
|
||||||
tell application "System Events"
|
tell application "System Events"
|
||||||
@@ -194,9 +200,9 @@ class MouseTracker {
|
|||||||
end tell
|
end tell
|
||||||
end tell
|
end tell
|
||||||
"""
|
"""
|
||||||
// applescript(scriptHide)
|
// applescript(scriptHide)
|
||||||
applescript(scriptMove)
|
applescript(scriptMove)
|
||||||
// applescript(scriptShow)
|
// applescript(scriptShow)
|
||||||
currentDockSide = toSide
|
currentDockSide = toSide
|
||||||
settings.settings.dockMoves += 1
|
settings.settings.dockMoves += 1
|
||||||
refreshMenus()
|
refreshMenus()
|
||||||
|
|||||||
71
DockPhobia/SettingsController.swift
Normal file
71
DockPhobia/SettingsController.swift
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
//
|
||||||
|
// Preferences.swift
|
||||||
|
// DockPhobia
|
||||||
|
//
|
||||||
|
// Created by neon443 on 29/05/2025.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Foundation
|
||||||
|
import AppKit
|
||||||
|
import Sparkle
|
||||||
|
|
||||||
|
class DPPreferencesWindowController: NSWindowController {
|
||||||
|
var mouseTracker: MouseTracker?
|
||||||
|
var settings: DPSettingsModel?
|
||||||
|
var updater: SPUStandardUpdaterController?
|
||||||
|
|
||||||
|
@IBOutlet weak var mouseRadio: NSButton!
|
||||||
|
@IBOutlet weak var dockRadio: NSButton!
|
||||||
|
@IBOutlet weak var updateCheckButton: NSButton!
|
||||||
|
@IBOutlet weak var smallDeathzoneToggle: NSButton!
|
||||||
|
|
||||||
|
@IBOutlet weak var quitbutton: NSButton!
|
||||||
|
|
||||||
|
override init(window: NSWindow?) {
|
||||||
|
super.init(window: window)
|
||||||
|
}
|
||||||
|
|
||||||
|
required init?(coder: NSCoder) {
|
||||||
|
super.init(coder: coder)
|
||||||
|
}
|
||||||
|
|
||||||
|
convenience init(mouseTracker: MouseTracker, settings: DPSettingsModel, updater: SPUStandardUpdaterController) {
|
||||||
|
self.init(windowNibName: "Preferences")
|
||||||
|
self.mouseTracker = mouseTracker
|
||||||
|
self.settings = settings
|
||||||
|
self.updater = updater
|
||||||
|
}
|
||||||
|
|
||||||
|
override func windowDidLoad() {
|
||||||
|
smallDeathzoneToggle.state = NSControl.StateValue(
|
||||||
|
settings!.settings.checkFullscreen ? 1 : 0
|
||||||
|
)
|
||||||
|
dockRadio.state = NSControl.StateValue(
|
||||||
|
settings!.settings.moveMouseInstead ? 0 : 1
|
||||||
|
)
|
||||||
|
mouseRadio.state = NSControl.StateValue(
|
||||||
|
settings!.settings.moveMouseInstead ? 1 : 0
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
@IBAction func checkUpdates(_ sender: Any) {
|
||||||
|
updater?.checkForUpdates(nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
@IBAction func MoveTypeSelect(_ sender: Any) {
|
||||||
|
if dockRadio.state.rawValue == 1 {
|
||||||
|
settings?.settings.moveMouseInstead = false
|
||||||
|
} else {
|
||||||
|
settings?.settings.moveMouseInstead = true
|
||||||
|
}
|
||||||
|
refreshMenus()
|
||||||
|
}
|
||||||
|
|
||||||
|
@IBAction func quit(_ sender: Any) {
|
||||||
|
NSApplication.shared.terminate(nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
@IBAction func smallDeathzoneToggle(_ sender: Any) {
|
||||||
|
settings?.settings.checkFullscreen.toggle()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -35,9 +35,6 @@ class SkyHigh {
|
|||||||
window.ignoresMouseEvents = true
|
window.ignoresMouseEvents = true
|
||||||
window.hasShadow = true
|
window.hasShadow = true
|
||||||
window.collectionBehavior = NSWindow.CollectionBehavior.canJoinAllSpaces.union(.stationary)
|
window.collectionBehavior = NSWindow.CollectionBehavior.canJoinAllSpaces.union(.stationary)
|
||||||
#if DEBUG
|
|
||||||
show()
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func move(to: CGPoint) {
|
func move(to: CGPoint) {
|
||||||
|
|||||||
@@ -414,19 +414,6 @@
|
|||||||
</items>
|
</items>
|
||||||
<point key="canvasLocation" x="200" y="121"/>
|
<point key="canvasLocation" x="200" y="121"/>
|
||||||
</menu>
|
</menu>
|
||||||
<menu id="ONX-cK-IuT">
|
<userDefaultsController representsSharedInstance="YES" id="KLo-tU-Av3"/>
|
||||||
<items>
|
|
||||||
<menuItem title="Item 1" id="6WY-F1-Y6A">
|
|
||||||
<modifierMask key="keyEquivalentModifierMask"/>
|
|
||||||
</menuItem>
|
|
||||||
<menuItem title="Item 2" id="Vew-Im-EWB">
|
|
||||||
<modifierMask key="keyEquivalentModifierMask"/>
|
|
||||||
</menuItem>
|
|
||||||
<menuItem title="Item 3" id="dVu-3p-SKK">
|
|
||||||
<modifierMask key="keyEquivalentModifierMask"/>
|
|
||||||
</menuItem>
|
|
||||||
</items>
|
|
||||||
<point key="canvasLocation" x="-160" y="321"/>
|
|
||||||
</menu>
|
|
||||||
</objects>
|
</objects>
|
||||||
</document>
|
</document>
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
//
|
|
||||||
// Preferences.swift
|
|
||||||
// DockPhobia
|
|
||||||
//
|
|
||||||
// Created by neon443 on 29/05/2025.
|
|
||||||
//
|
|
||||||
|
|
||||||
import Foundation
|
|
||||||
122
DockPhobia/Views/Preferences.xib
Normal file
122
DockPhobia/Views/Preferences.xib
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23727" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||||
|
<dependencies>
|
||||||
|
<deployment identifier="macosx"/>
|
||||||
|
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23727"/>
|
||||||
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
|
</dependencies>
|
||||||
|
<objects>
|
||||||
|
<customObject id="-2" userLabel="File's Owner" customClass="DPPreferencesWindowController" customModule="DockPhobia" customModuleProvider="target">
|
||||||
|
<connections>
|
||||||
|
<outlet property="dockRadio" destination="SML-7D-HqD" id="4QO-vf-9ma"/>
|
||||||
|
<outlet property="mouseRadio" destination="xQV-F8-e5K" id="2cJ-W4-uYY"/>
|
||||||
|
<outlet property="quitbutton" destination="7DK-yJ-I42" id="fDP-cd-88f"/>
|
||||||
|
<outlet property="smallDeathzoneToggle" destination="TNA-PK-KGC" id="rTv-BF-hv6"/>
|
||||||
|
<outlet property="updateCheckButton" destination="bnA-Vz-L4F" id="16N-mV-Agw"/>
|
||||||
|
<outlet property="window" destination="85c-fa-xeM" id="B5X-4l-mcR"/>
|
||||||
|
</connections>
|
||||||
|
</customObject>
|
||||||
|
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||||
|
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||||
|
<window title="DockPhobia Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="85c-fa-xeM">
|
||||||
|
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" texturedBackground="YES"/>
|
||||||
|
<rect key="contentRect" x="683" y="389" width="423" height="186"/>
|
||||||
|
<rect key="screenRect" x="0.0" y="0.0" width="1710" height="1069"/>
|
||||||
|
<view key="contentView" wantsLayer="YES" id="wEz-dE-A27">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="423" height="186"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
|
<subviews>
|
||||||
|
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bnA-Vz-L4F">
|
||||||
|
<rect key="frame" x="13" y="8" width="159" height="32"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||||
|
<buttonCell key="cell" type="push" title="Check for Updates..." bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="XBJ-UK-x73">
|
||||||
|
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||||
|
<font key="font" metaFont="system"/>
|
||||||
|
</buttonCell>
|
||||||
|
<connections>
|
||||||
|
<action selector="checkUpdates:" target="-2" id="AX2-PR-jPb"/>
|
||||||
|
</connections>
|
||||||
|
</button>
|
||||||
|
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="SML-7D-HqD">
|
||||||
|
<rect key="frame" x="87" y="149" width="67" height="18"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
|
||||||
|
<buttonCell key="cell" type="radio" title="Dock" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="Lxi-8n-jY3">
|
||||||
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
|
<font key="font" metaFont="system"/>
|
||||||
|
</buttonCell>
|
||||||
|
<connections>
|
||||||
|
<action selector="MoveTypeSelect:" target="-2" id="PP9-SC-6xN"/>
|
||||||
|
</connections>
|
||||||
|
</button>
|
||||||
|
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xQV-F8-e5K">
|
||||||
|
<rect key="frame" x="87" y="121" width="67" height="24"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
|
||||||
|
<buttonCell key="cell" type="radio" title="Mouse" bezelStyle="regularSquare" imagePosition="left" inset="2" id="86E-Km-LZ7">
|
||||||
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
|
<font key="font" metaFont="system"/>
|
||||||
|
</buttonCell>
|
||||||
|
<connections>
|
||||||
|
<action selector="MoveTypeSelect:" target="-2" id="dfh-6B-58k"/>
|
||||||
|
</connections>
|
||||||
|
</button>
|
||||||
|
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="U5P-YK-hTs">
|
||||||
|
<rect key="frame" x="18" y="150" width="60" height="16"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
|
||||||
|
<textFieldCell key="cell" lineBreakMode="clipping" title="Move the" id="4wN-vE-QCE">
|
||||||
|
<font key="font" metaFont="system"/>
|
||||||
|
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||||
|
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||||
|
</textFieldCell>
|
||||||
|
</textField>
|
||||||
|
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="vyh-vP-oAh">
|
||||||
|
<rect key="frame" x="160" y="150" width="245" height="16"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" flexibleMinY="YES"/>
|
||||||
|
<textFieldCell key="cell" lineBreakMode="clipping" title="when the cursor gets close to the Dock." id="y3x-vy-qbu">
|
||||||
|
<font key="font" metaFont="system"/>
|
||||||
|
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||||
|
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||||
|
</textFieldCell>
|
||||||
|
</textField>
|
||||||
|
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="TNA-PK-KGC">
|
||||||
|
<rect key="frame" x="18" y="81" width="216" height="18"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||||
|
<buttonCell key="cell" type="check" title="Smaller deathzone in fullscreen" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="28Y-O4-oAQ">
|
||||||
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
|
<font key="font" metaFont="system"/>
|
||||||
|
</buttonCell>
|
||||||
|
<connections>
|
||||||
|
<action selector="smallDeathzoneToggle:" target="-2" id="zlu-Ca-p04"/>
|
||||||
|
</connections>
|
||||||
|
</button>
|
||||||
|
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3Pd-Xt-fTA">
|
||||||
|
<rect key="frame" x="18" y="60" width="136" height="14"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||||
|
<textFieldCell key="cell" lineBreakMode="clipping" title="May reduce performance" id="Orh-5m-Me2">
|
||||||
|
<font key="font" metaFont="system" size="11"/>
|
||||||
|
<color key="textColor" name="secondaryLabelColor" catalog="System" colorSpace="catalog"/>
|
||||||
|
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||||
|
</textFieldCell>
|
||||||
|
</textField>
|
||||||
|
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7DK-yJ-I42">
|
||||||
|
<rect key="frame" x="343" y="14" width="60" height="19"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
|
||||||
|
<buttonCell key="cell" type="roundRect" title="Quit" bezelStyle="roundedRect" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="jbc-01-FBx">
|
||||||
|
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||||
|
<font key="font" metaFont="system"/>
|
||||||
|
</buttonCell>
|
||||||
|
<connections>
|
||||||
|
<action selector="quit:" target="-2" id="483-Pc-QoS"/>
|
||||||
|
</connections>
|
||||||
|
</button>
|
||||||
|
</subviews>
|
||||||
|
</view>
|
||||||
|
<toolbar key="toolbar" implicitIdentifier="3DBA283D-9272-4F9B-8799-AA8355F2BE79" autosavesConfiguration="NO" showsBaselineSeparator="NO" displayMode="iconAndLabel" sizeMode="regular" id="MWN-PM-U77">
|
||||||
|
<allowedToolbarItems/>
|
||||||
|
<defaultToolbarItems/>
|
||||||
|
</toolbar>
|
||||||
|
<contentBorderThickness minY="0.0" maxY="0.0"/>
|
||||||
|
<point key="canvasLocation" x="-213.5" y="-103"/>
|
||||||
|
</window>
|
||||||
|
<userDefaultsController representsSharedInstance="YES" id="zYZ-vc-iso"/>
|
||||||
|
</objects>
|
||||||
|
</document>
|
||||||
BIN
DockPhobiaPy/.DS_Store
vendored
BIN
DockPhobiaPy/.DS_Store
vendored
Binary file not shown.
Reference in New Issue
Block a user