1
0
mirror of https://github.com/Toxblh/MTMR.git synced 2026-01-10 17:08:39 +00:00

Different approach

This commit is contained in:
Toxblh 2018-04-09 11:59:44 +01:00
parent aaa7bc33bc
commit e3f5da0294
6 changed files with 3 additions and 13 deletions

View File

@ -412,7 +412,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.12; MACOSX_DEPLOYMENT_TARGET = 10.12.2;
MTL_ENABLE_DEBUG_INFO = YES; MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx; SDKROOT = macosx;
@ -465,7 +465,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.12; MACOSX_DEPLOYMENT_TARGET = 10.12.2;
MTL_ENABLE_DEBUG_INFO = NO; MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx; SDKROOT = macosx;
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";

View File

@ -12,11 +12,7 @@ import Cocoa
class AppDelegate: NSObject, NSApplicationDelegate { class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_ aNotification: Notification) { func applicationDidFinishLaunching(_ aNotification: Notification) {
if #available(OSX 10.12.2, *) { TouchBarController.shared.setupControlStripPresence()
TouchBarController.shared.setupControlStripPresence()
} else {
// Fallback on earlier versions
}
// Insert code here to initialize your application // Insert code here to initialize your application
} }

View File

@ -1,6 +1,5 @@
import Foundation import Foundation
@available(OSX 10.12.2, *)
class AppleScriptTouchBarItem: NSCustomTouchBarItem { class AppleScriptTouchBarItem: NSCustomTouchBarItem {
let script: NSAppleScript let script: NSAppleScript
private var timer: Timer! private var timer: Timer!

View File

@ -1,6 +1,5 @@
import Cocoa import Cocoa
@available(OSX 10.12.2, *)
class TimeTouchBarItem: NSCustomTouchBarItem { class TimeTouchBarItem: NSCustomTouchBarItem {
private let dateFormatter = DateFormatter() private let dateFormatter = DateFormatter()
private var timer: Timer! private var timer: Timer!

View File

@ -8,7 +8,6 @@
import Cocoa import Cocoa
@available(OSX 10.12.2, *)
class TouchBarController: NSObject, NSTouchBarDelegate { class TouchBarController: NSObject, NSTouchBarDelegate {
static let shared = TouchBarController() static let shared = TouchBarController()
@ -102,7 +101,6 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
} }
@available(OSX 10.12.2, *)
extension CustomButtonTouchBarItem { extension CustomButtonTouchBarItem {
convenience init(identifier: NSTouchBarItem.Identifier, title: String, HIDKeycode: Int) { convenience init(identifier: NSTouchBarItem.Identifier, title: String, HIDKeycode: Int) {
self.init(identifier: identifier, title: title) { _ in self.init(identifier: identifier, title: title) { _ in

View File

@ -8,7 +8,6 @@
import Cocoa import Cocoa
@available(OSX 10.12.2, *)
extension NSTouchBarItem.Identifier { extension NSTouchBarItem.Identifier {
static let escButton = NSTouchBarItem.Identifier("com.toxblh.mtmr.escButton") static let escButton = NSTouchBarItem.Identifier("com.toxblh.mtmr.escButton")
static let dismissButton = NSTouchBarItem.Identifier("com.toxblh.mtmr.dismissButton") static let dismissButton = NSTouchBarItem.Identifier("com.toxblh.mtmr.dismissButton")
@ -36,7 +35,6 @@ extension NSTouchBarItem.Identifier {
static let controlStripItem = NSTouchBarItem.Identifier("com.toxblh.mtmr.controlStrip") static let controlStripItem = NSTouchBarItem.Identifier("com.toxblh.mtmr.controlStrip")
} }
@available(OSX 10.12.2, *)
class CustomButtonTouchBarItem: NSCustomTouchBarItem { class CustomButtonTouchBarItem: NSCustomTouchBarItem {
let tapClosure: (NSCustomTouchBarItem) -> () let tapClosure: (NSCustomTouchBarItem) -> ()