Skip to content

Commit

Permalink
less line breack
Browse files Browse the repository at this point in the history
  • Loading branch information
guidouil committed Nov 29, 2016
1 parent 247ca0a commit 42e58be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
Binary file not shown.
17 changes: 3 additions & 14 deletions TouchBarBar/WindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,32 @@

import Cocoa


fileprivate extension NSTouchBarCustomizationIdentifier {

static let touchBar = NSTouchBarCustomizationIdentifier("com.hung-truong.touchfart")
static let touchBar = NSTouchBarCustomizationIdentifier("com.guidouil.touchbarbar")
}

fileprivate extension NSTouchBarItemIdentifier {

static let champagne = NSTouchBarItemIdentifier("champagne")
static let cocktail = NSTouchBarItemIdentifier("cocktail")
static let beer = NSTouchBarItemIdentifier("beer")
static let martini = NSTouchBarItemIdentifier("martini")
}


class WindowController: NSWindowController, NSTouchBarDelegate {

override func windowDidLoad() {
super.windowDidLoad()

// Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
}



func Isaac(sender: NSButton) {
let title = sender.title

guard let sound = NSSound(named: title) else {
return
}
sound.play()

}



@available(OSX 10.12.1, *)
override func makeTouchBar() -> NSTouchBar? {
let touchBar = NSTouchBar()
Expand All @@ -51,7 +42,6 @@ class WindowController: NSWindowController, NSTouchBarDelegate {
touchBar.defaultItemIdentifiers = [.champagne, .cocktail, .beer, .martini]

return touchBar

}

@available(OSX 10.12.1, *)
Expand Down Expand Up @@ -79,7 +69,6 @@ class WindowController: NSWindowController, NSTouchBarDelegate {
let button = NSButton(title: "🍹", target: self, action: #selector(Isaac))
touchBarItem.view = button
return touchBarItem

}
}
}

0 comments on commit 42e58be

Please sign in to comment.