Compare commits

..
6 Commits
Author SHA1 Message Date
toxblh 92b6e5ef33 full media keys 2018-04-09 08:40:38 +01:00
Anton Palgunov d97d8efdd4 Merge pull request #2 from Toxblh/add-license-1
Create LICENSE
2018-04-09 08:33:20 +01:00
Anton Palgunov 9f6f7d9404 Create LICENSE 2018-04-09 08:33:02 +01:00
Anton Palgunov 528506f276 Merge pull request #1 from ReDetection/master
TouchBar without the cross and stripe menu
2018-04-09 08:31:34 +01:00
Serg ce7c3c5883 display custom touchbar without control strip and builtin close button 2018-04-09 13:16:14 +07:00
Serg 3d3ad0f076 add readme into project (no target) for convenience 2018-04-09 13:15:52 +07:00
5 changed files with 36 additions and 7 deletions
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 Anton Palgunov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+2
View File
@@ -40,6 +40,7 @@
/* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */
36C2ECD2207B3B1D003CDA33 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
B059D621205E03F5006E6B86 /* TouchBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TouchBarController.swift; sourceTree = "<group>"; };
B059D623205E04F3006E6B86 /* TouchBarItems.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TouchBarItems.swift; sourceTree = "<group>"; };
B059D629205E13E5006E6B86 /* TouchBarPrivateApi.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TouchBarPrivateApi.h; sourceTree = "<group>"; };
@@ -102,6 +103,7 @@
B082B246205C7D8000BC04DC = {
isa = PBXGroup;
children = (
36C2ECD2207B3B1D003CDA33 /* README.md */,
B082B251205C7D8000BC04DC /* MTMR */,
B082B264205C7D8000BC04DC /* MTMRTests */,
B082B26F205C7D8000BC04DC /* MTMRUITests */,
+11 -6
View File
@@ -22,6 +22,7 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
touchBar.delegate = self
touchBar.defaultItemIdentifiers = [
.escButton,
.dismissButton,
.brightDown,
.brightUp,
@@ -55,10 +56,10 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
}
@objc private func presentTouchBar() {
NSTouchBar.presentSystemModalFunctionBar(touchBar, systemTrayItemIdentifier: .controlStripItem)
NSTouchBar.presentSystemModalFunctionBar(touchBar, placement: 1, systemTrayItemIdentifier: .controlStripItem)
}
private func dismissTouchBar() {
@objc private func dismissTouchBar() {
NSTouchBar.minimizeSystemModalFunctionBar(touchBar)
}
@@ -68,6 +69,10 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
let item = NSCustomTouchBarItem(identifier: identifier)
item.view = NSButton(title: "esc", target: self, action: #selector(handleEsc))
return item
case .dismissButton:
let item = NSCustomTouchBarItem(identifier: identifier)
item.view = NSButton(title: "exit", target: self, action: #selector(dismissTouchBar))
return item
case .brightUp:
let item = NSCustomTouchBarItem(identifier: identifier)
@@ -87,10 +92,10 @@ class TouchBarController: NSObject, NSTouchBarDelegate {
item.view = NSButton(title: "🔊", target: self, action: #selector(handleVolumeUp))
return item
// case .prev:
// let item = NSCustomTouchBarItem(identifier: identifier)
// item.view = NSButton(title: "⏪", target: self, action: #selector(handlePrev))
// return item
case .prev:
let item = NSCustomTouchBarItem(identifier: identifier)
item.view = NSButton(title: "⏪", target: self, action: #selector(handlePrev))
return item
case .play:
let item = NSCustomTouchBarItem(identifier: identifier)
item.view = NSButton(title: "⏯", target: self, action: #selector(handlePlay))
+1
View File
@@ -10,6 +10,7 @@ import Cocoa
extension NSTouchBarItem.Identifier {
static let escButton = NSTouchBarItem.Identifier("com.toxblh.mtmr.escButton")
static let dismissButton = NSTouchBarItem.Identifier("com.toxblh.mtmr.dismissButton")
// Volume
static let volumeUp = NSTouchBarItem.Identifier("com.toxblh.mtmr.volumeUp")
+1 -1
View File
@@ -17,6 +17,6 @@ My the idea is to create the program like a platform for plugins for customizati
- [x] Time in touchbar!
- [ ] First the weather plugin
- [ ] Create the same panel like in my [BTT preset](https://github.com/Toxblh/btt-touchbar-preset)
- [ ] Find how to open full-screen TouchBar without the cross and stripe menu
- [x] Find how to open full-screen TouchBar without the cross and stripe menu
- [ ] Find how to add haptic feedback
- [ ] Refactoring the application on packages (AppleScript, JavaScript? and Swift?)