From 7774b1fa5e0a9ac91852b6503a05286a629853e1 Mon Sep 17 00:00:00 2001 From: ad Date: Tue, 17 Apr 2018 10:55:21 +0300 Subject: [PATCH] * add shadow to app scrubber --- MTMR/AppScrubberTouchBarItem.swift | 2 ++ MTMR/AppleScriptTouchBarItem.swift | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/MTMR/AppScrubberTouchBarItem.swift b/MTMR/AppScrubberTouchBarItem.swift index 3c5a80a..50b652f 100644 --- a/MTMR/AppScrubberTouchBarItem.swift +++ b/MTMR/AppScrubberTouchBarItem.swift @@ -35,8 +35,10 @@ class AppScrubberTouchBarItem: NSCustomTouchBarItem, NSScrubberDelegate, NSScrub scrubber.mode = .free // .fixed let layout = NSScrubberFlowLayout(); layout.itemSize = NSSize(width: 44, height: 30) + layout.itemSpacing = 2 scrubber.scrubberLayout = layout scrubber.selectionBackgroundStyle = .roundedBackground + scrubber.showsAdditionalContentIndicators = true view = scrubber diff --git a/MTMR/AppleScriptTouchBarItem.swift b/MTMR/AppleScriptTouchBarItem.swift index c49914b..352ec8d 100644 --- a/MTMR/AppleScriptTouchBarItem.swift +++ b/MTMR/AppleScriptTouchBarItem.swift @@ -7,7 +7,7 @@ class AppleScriptTouchBarItem: CustomButtonTouchBarItem { init?(identifier: NSTouchBarItem.Identifier, source: SourceProtocol, interval: TimeInterval, onTap: @escaping ()->()) { self.interval = interval - super.init(identifier: identifier, title: "compile", onTap: onTap) + super.init(identifier: identifier, title: "⏳", onTap: onTap) self.forceHideConstraint = self.view.widthAnchor.constraint(equalToConstant: 0) guard let script = source.appleScript else { button.title = "no script" @@ -18,9 +18,9 @@ class AppleScriptTouchBarItem: CustomButtonTouchBarItem { DispatchQueue.main.async { var error: NSDictionary? guard script.compileAndReturnError(&error) else { - print(error?.description ?? "unknown error") +// print(error?.description ?? "unknown error") DispatchQueue.main.async { - self.button.title = "compile error" + self.button.title = "error" } return } @@ -33,7 +33,7 @@ class AppleScriptTouchBarItem: CustomButtonTouchBarItem { } func refreshAndSchedule() { - print("refresh happened") +// print("refresh happened") let scriptResult = self.execute() DispatchQueue.main.async { self.button.title = scriptResult