diff --git a/DockPhobia.xcodeproj/project.pbxproj b/DockPhobia.xcodeproj/project.pbxproj index 496eb33..676c16d 100644 --- a/DockPhobia.xcodeproj/project.pbxproj +++ b/DockPhobia.xcodeproj/project.pbxproj @@ -301,7 +301,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.13; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.neon443.DockPhobia; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -334,7 +334,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.13; MARKETING_VERSION = 1.0; PRODUCT_BUNDLE_IDENTIFIER = com.neon443.DockPhobia; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/DockPhobia/AppDelegate.swift b/DockPhobia/AppDelegate.swift index 644e95f..b081b78 100644 --- a/DockPhobia/AppDelegate.swift +++ b/DockPhobia/AppDelegate.swift @@ -18,7 +18,7 @@ class AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ aNotification: Notification) { statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength) if let button = statusItem.button { - button.image = NSImage(named: "cursor") + button.image = NSImage(named: "cursor.slash") } setupMenus() } @@ -41,8 +41,12 @@ class AppDelegate: NSObject, NSApplicationDelegate { } func changeMenuIcon(running: Bool) { - if let button = statusItem.button { - button.image = NSImage(named: "cursor\(running ? ".motion" : "")") + guard let button = statusItem.button else { return } + switch running { + case true: + button.image = NSImage(named: "cursor.motion") + case false: + button.image = NSImage(named: "cursor.slash") } } diff --git a/DockPhobia/MouseTracker.swift b/DockPhobia/MouseTracker.swift index 6c6290d..f64053a 100644 --- a/DockPhobia/MouseTracker.swift +++ b/DockPhobia/MouseTracker.swift @@ -37,8 +37,6 @@ class MouseTracker { } else { fatalError("no screen wtf???") } - moveDock(.left) - moveDock(.bottom) } func checkMouse(_ event: NSEvent) { @@ -48,7 +46,31 @@ class MouseTracker { print(location) #endif if location.y > 1000 { - + if location.x < screen.width/2 { + moveDock(.right) + return + } else { + moveDock(.left) + return + } + } + if location.x < 100 { + if location.y < screen.height/2 { + moveDock(.bottom) + return + } else { + moveDock(.right) + return + } + } + if location.x > 1600 { + if location.y < screen.height/2 { + moveDock(.bottom) + return + } else { + moveDock(.left) + return + } } }