diff --git a/MTMR.xcodeproj/project.pbxproj b/MTMR.xcodeproj/project.pbxproj index 87547f6..3037389 100644 --- a/MTMR.xcodeproj/project.pbxproj +++ b/MTMR.xcodeproj/project.pbxproj @@ -14,10 +14,9 @@ 36C2ECDE207C82DE003CDA33 /* ItemsParsing.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36C2ECDA207C3FE7003CDA33 /* ItemsParsing.swift */; }; 36C2ECE0207CB1B0003CDA33 /* defaultPreset.json in Resources */ = {isa = PBXBuildFile; fileRef = 36C2ECDF207CB1B0003CDA33 /* defaultPreset.json */; }; B059D622205E03F5006E6B86 /* TouchBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B059D621205E03F5006E6B86 /* TouchBarController.swift */; }; - B059D624205E04F3006E6B86 /* TouchBarItems.swift in Sources */ = {isa = PBXBuildFile; fileRef = B059D623205E04F3006E6B86 /* TouchBarItems.swift */; }; + B059D624205E04F3006E6B86 /* CustomButtonTouchBarItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = B059D623205E04F3006E6B86 /* CustomButtonTouchBarItem.swift */; }; B059D62D205F11E8006E6B86 /* DFRFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B059D62C205F11E8006E6B86 /* DFRFoundation.framework */; }; B082B253205C7D8000BC04DC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = B082B252205C7D8000BC04DC /* AppDelegate.swift */; }; - B082B255205C7D8000BC04DC /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B082B254205C7D8000BC04DC /* ViewController.swift */; }; B082B257205C7D8000BC04DC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B082B256205C7D8000BC04DC /* Assets.xcassets */; }; B082B25A205C7D8000BC04DC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B082B258205C7D8000BC04DC /* Main.storyboard */; }; B09EB1E4207C082000D5C1E0 /* HapticFeedback.swift in Sources */ = {isa = PBXBuildFile; fileRef = B09EB1E3207C082000D5C1E0 /* HapticFeedback.swift */; }; @@ -33,7 +32,6 @@ B0B17438207D6B590004B740 /* Vox.next.scpt in Resources */ = {isa = PBXBuildFile; fileRef = B0B1742E207D6B590004B740 /* Vox.next.scpt */; }; B0B17439207D6B590004B740 /* Vox.nowPlaying.scpt in Resources */ = {isa = PBXBuildFile; fileRef = B0B1742F207D6B590004B740 /* Vox.nowPlaying.scpt */; }; B0B1743A207D6B590004B740 /* iTunes.nowPlaying.scpt in Resources */ = {isa = PBXBuildFile; fileRef = B0B17430207D6B590004B740 /* iTunes.nowPlaying.scpt */; }; - B0C1CFCA205C97D30021C862 /* WindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B0C1CFC9205C97D30021C862 /* WindowController.swift */; }; B0F8771A207AC1EA00D6E430 /* TouchBarSupport.m in Sources */ = {isa = PBXBuildFile; fileRef = B0F87719207AC1EA00D6E430 /* TouchBarSupport.m */; }; /* End PBXBuildFile section */ @@ -56,13 +54,12 @@ 36C2ECDC207C723B003CDA33 /* ParseConfigTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParseConfigTests.swift; sourceTree = ""; }; 36C2ECDF207CB1B0003CDA33 /* defaultPreset.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = defaultPreset.json; sourceTree = ""; }; B059D621205E03F5006E6B86 /* TouchBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TouchBarController.swift; sourceTree = ""; }; - B059D623205E04F3006E6B86 /* TouchBarItems.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TouchBarItems.swift; sourceTree = ""; }; + B059D623205E04F3006E6B86 /* CustomButtonTouchBarItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomButtonTouchBarItem.swift; sourceTree = ""; }; B059D629205E13E5006E6B86 /* TouchBarPrivateApi.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TouchBarPrivateApi.h; sourceTree = ""; }; B059D62A205F0E7D006E6B86 /* TouchBarPrivateApi-Bridging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "TouchBarPrivateApi-Bridging.h"; sourceTree = ""; }; B059D62C205F11E8006E6B86 /* DFRFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DFRFoundation.framework; path = ../../../../../System/Library/PrivateFrameworks/DFRFoundation.framework; sourceTree = ""; }; B082B24F205C7D8000BC04DC /* MTMR.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MTMR.app; sourceTree = BUILT_PRODUCTS_DIR; }; B082B252205C7D8000BC04DC /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - B082B254205C7D8000BC04DC /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; B082B256205C7D8000BC04DC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; B082B259205C7D8000BC04DC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; B082B25B205C7D8000BC04DC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -82,7 +79,6 @@ B0B1742E207D6B590004B740 /* Vox.next.scpt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Vox.next.scpt; sourceTree = ""; }; B0B1742F207D6B590004B740 /* Vox.nowPlaying.scpt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Vox.nowPlaying.scpt; sourceTree = ""; }; B0B17430207D6B590004B740 /* iTunes.nowPlaying.scpt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = iTunes.nowPlaying.scpt; sourceTree = ""; }; - B0C1CFC9205C97D30021C862 /* WindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WindowController.swift; sourceTree = ""; }; B0F87719207AC1EA00D6E430 /* TouchBarSupport.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TouchBarSupport.m; sourceTree = ""; }; B0F8771B207AC92700D6E430 /* TouchBarSupport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TouchBarSupport.h; sourceTree = ""; }; /* End PBXFileReference section */ @@ -143,15 +139,13 @@ B0B1743B207D6ED40004B740 /* CBridge */, B0B17426207D6AFE0004B740 /* AppleScripts */, B082B252205C7D8000BC04DC /* AppDelegate.swift */, - B082B254205C7D8000BC04DC /* ViewController.swift */, B082B256205C7D8000BC04DC /* Assets.xcassets */, B0A7E9A9205D6AA400EEF070 /* KeyPress.swift */, - B059D623205E04F3006E6B86 /* TouchBarItems.swift */, + B059D623205E04F3006E6B86 /* CustomButtonTouchBarItem.swift */, 36C2ECD8207B74B4003CDA33 /* AppleScriptTouchBarItem.swift */, 36C2ECD6207B6DAE003CDA33 /* TimeTouchBarItem.swift */, B059D621205E03F5006E6B86 /* TouchBarController.swift */, 36C2ECDA207C3FE7003CDA33 /* ItemsParsing.swift */, - B0C1CFC9205C97D30021C862 /* WindowController.swift */, B082B258205C7D8000BC04DC /* Main.storyboard */, B082B25B205C7D8000BC04DC /* Info.plist */, B082B25C205C7D8000BC04DC /* MTMR.entitlements */, @@ -316,11 +310,9 @@ files = ( B059D622205E03F5006E6B86 /* TouchBarController.swift in Sources */, 36C2ECD9207B74B4003CDA33 /* AppleScriptTouchBarItem.swift in Sources */, - B082B255205C7D8000BC04DC /* ViewController.swift in Sources */, - B0C1CFCA205C97D30021C862 /* WindowController.swift in Sources */, B0F8771A207AC1EA00D6E430 /* TouchBarSupport.m in Sources */, B082B253205C7D8000BC04DC /* AppDelegate.swift in Sources */, - B059D624205E04F3006E6B86 /* TouchBarItems.swift in Sources */, + B059D624205E04F3006E6B86 /* CustomButtonTouchBarItem.swift in Sources */, B09EB1E4207C082000D5C1E0 /* HapticFeedback.swift in Sources */, 36C2ECDB207C3FE7003CDA33 /* ItemsParsing.swift in Sources */, B0A7E9AA205D6AA400EEF070 /* KeyPress.swift in Sources */, diff --git a/MTMR/Base.lproj/Main.storyboard b/MTMR/Base.lproj/Main.storyboard index b059509..546ef81 100644 --- a/MTMR/Base.lproj/Main.storyboard +++ b/MTMR/Base.lproj/Main.storyboard @@ -1,9 +1,8 @@ - + - - + @@ -681,29 +680,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/MTMR/TouchBarItems.swift b/MTMR/CustomButtonTouchBarItem.swift similarity index 88% rename from MTMR/TouchBarItems.swift rename to MTMR/CustomButtonTouchBarItem.swift index 1297d43..0a91d83 100644 --- a/MTMR/TouchBarItems.swift +++ b/MTMR/CustomButtonTouchBarItem.swift @@ -8,10 +8,6 @@ import Cocoa -extension NSTouchBarItem.Identifier { - static let controlStripItem = NSTouchBarItem.Identifier("com.toxblh.mtmr.controlStrip") -} - class CustomButtonTouchBarItem: NSCustomTouchBarItem { let tapClosure: () -> () private(set) var button: NSButton! diff --git a/MTMR/TouchBarController.swift b/MTMR/TouchBarController.swift index dba4dd0..a8927d5 100644 --- a/MTMR/TouchBarController.swift +++ b/MTMR/TouchBarController.swift @@ -32,6 +32,10 @@ extension ItemType { } +extension NSTouchBarItem.Identifier { + static let controlStripItem = NSTouchBarItem.Identifier("com.toxblh.mtmr.controlStrip") +} + class TouchBarController: NSObject, NSTouchBarDelegate { static let shared = TouchBarController() diff --git a/MTMR/ViewController.swift b/MTMR/ViewController.swift deleted file mode 100644 index db56ed6..0000000 --- a/MTMR/ViewController.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// ViewController.swift -// MTMR -// -// Created by Anton Palgunov on 16/03/2018. -// Copyright © 2018 Anton Palgunov. All rights reserved. -// - -import Cocoa - -class ViewController: NSViewController { - - override func viewDidLoad() { - super.viewDidLoad() - - // Do any additional setup after loading the view. - } - - override var representedObject: Any? { - didSet { - // Update the view, if already loaded. - } - } - - -} - diff --git a/MTMR/WindowController.swift b/MTMR/WindowController.swift deleted file mode 100644 index baaf6f1..0000000 --- a/MTMR/WindowController.swift +++ /dev/null @@ -1,17 +0,0 @@ -// -// WindowController.swift -// MTMR -// -// Created by Anton Palgunov on 17/03/2018. -// Copyright © 2018 Anton Palgunov. All rights reserved. -// - -import Cocoa - -class WindowController: NSWindowController { - - override func windowDidLoad() { - super.windowDidLoad() - - } -} diff --git a/TECHNICAL_DEBT.md b/TECHNICAL_DEBT.md index 9c4046f..8825331 100644 --- a/TECHNICAL_DEBT.md +++ b/TECHNICAL_DEBT.md @@ -2,3 +2,4 @@ * try view controllers on `NSCustomTouchBarItem` instead of subclassing item itself * try move away from enums when parse preset – enums are hard to extend +* find better way to hide bar items