mirror of
https://github.com/neon443/DockPhobia.git
synced 2026-03-11 06:49:12 +00:00
FINALLY
created settings window that actually shows up
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 = "<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>"; };
|
||||
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 */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@@ -56,8 +58,8 @@
|
||||
A94BEC102DE23ECE00D4811D /* Views */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
A9C9B0702DE9F6E60039D7A5 /* Preferences.xib */,
|
||||
A94BEC0E2DE23E8500D4811D /* MainMenu.xib */,
|
||||
A9C9B0672DE888B20039D7A5 /* Preferences.swift */,
|
||||
);
|
||||
path = Views;
|
||||
sourceTree = "<group>";
|
||||
@@ -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 */,
|
||||
|
||||
BIN
DockPhobia/.DS_Store
vendored
BIN
DockPhobia/.DS_Store
vendored
Binary file not shown.
@@ -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()
|
||||
|
||||
26
DockPhobia/SettingsController.swift
Normal file
26
DockPhobia/SettingsController.swift
Normal file
@@ -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")
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
//
|
||||
// Preferences.swift
|
||||
// DockPhobia
|
||||
//
|
||||
// Created by neon443 on 29/05/2025.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
39
DockPhobia/Views/Preferences.xib
Normal file
39
DockPhobia/Views/Preferences.xib
Normal file
@@ -0,0 +1,39 @@
|
||||
<?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="updateCheckButton" destination="bnA-Vz-L4F" id="8Zf-Am-gPt"/>
|
||||
<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="Window" 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"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="167" y="210" width="480" height="270"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1710" height="1069"/>
|
||||
<view key="contentView" id="wEz-dE-A27">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bnA-Vz-L4F">
|
||||
<rect key="frame" x="203" y="118" width="75" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Button" 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>
|
||||
</button>
|
||||
</subviews>
|
||||
</view>
|
||||
<point key="canvasLocation" x="-185" y="-61"/>
|
||||
</window>
|
||||
</objects>
|
||||
</document>
|
||||
Reference in New Issue
Block a user