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

* add shadow to app scrubber

This commit is contained in:
ad 2018-04-17 10:55:21 +03:00
parent 20699e9de7
commit 7774b1fa5e
2 changed files with 6 additions and 4 deletions

View File

@ -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

View File

@ -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