mirror of
https://github.com/Toxblh/MTMR.git
synced 2026-01-10 17:08:39 +00:00
added StatusMenu. Del from Dock.
This commit is contained in:
parent
65e3d67c32
commit
713f4dffc7
@ -10,16 +10,34 @@ import Cocoa
|
|||||||
|
|
||||||
@NSApplicationMain
|
@NSApplicationMain
|
||||||
class AppDelegate: NSObject, NSApplicationDelegate {
|
class AppDelegate: NSObject, NSApplicationDelegate {
|
||||||
|
let statusItem = NSStatusBar.system.statusItem(withLength:NSStatusItem.squareLength)
|
||||||
|
|
||||||
func applicationDidFinishLaunching(_ aNotification: Notification) {
|
func applicationDidFinishLaunching(_ aNotification: Notification) {
|
||||||
TouchBarController.shared.setupControlStripPresence()
|
|
||||||
// Insert code here to initialize your application
|
// Insert code here to initialize your application
|
||||||
|
TouchBarController.shared.setupControlStripPresence()
|
||||||
|
|
||||||
|
if let button = statusItem.button {
|
||||||
|
button.image = #imageLiteral(resourceName: "StatusImage")
|
||||||
|
}
|
||||||
|
createMenu()
|
||||||
}
|
}
|
||||||
|
|
||||||
func applicationWillTerminate(_ aNotification: Notification) {
|
func applicationWillTerminate(_ aNotification: Notification) {
|
||||||
// Insert code here to tear down your application
|
// Insert code here to tear down your application
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@objc func testFn(_ sender: Any?) {
|
||||||
|
let quoteText = "You click on menu"
|
||||||
|
print(quoteText)
|
||||||
|
}
|
||||||
|
|
||||||
|
func createMenu() {
|
||||||
|
let menu = NSMenu()
|
||||||
|
menu.addItem(withTitle: "Preferences", action: #selector(testFn(_:)), keyEquivalent: ",")
|
||||||
|
menu.addItem(NSMenuItem.separator())
|
||||||
|
menu.addItem(withTitle: "Quit", action: #selector(NSApplication.terminate(_:)), keyEquivalent: "q")
|
||||||
|
statusItem.menu = menu
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
24
MTMR/Assets.xcassets/StatusImage.imageset/Contents.json
vendored
Normal file
24
MTMR/Assets.xcassets/StatusImage.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "StatusImage.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
},
|
||||||
|
"properties" : {
|
||||||
|
"template-rendering-intent" : "template"
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
MTMR/Assets.xcassets/StatusImage.imageset/StatusImage.png
vendored
Normal file
BIN
MTMR/Assets.xcassets/StatusImage.imageset/StatusImage.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
@ -1,7 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
|
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="14109" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
|
<deployment identifier="macosx"/>
|
||||||
|
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14109"/>
|
||||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<scenes>
|
<scenes>
|
||||||
@ -680,27 +681,6 @@
|
|||||||
</objects>
|
</objects>
|
||||||
<point key="canvasLocation" x="75" y="0.0"/>
|
<point key="canvasLocation" x="75" y="0.0"/>
|
||||||
</scene>
|
</scene>
|
||||||
<!--Window Controller-->
|
|
||||||
<scene sceneID="R2V-B0-nI4">
|
|
||||||
<objects>
|
|
||||||
<windowController id="B8D-0N-5wS" customClass="WindowController" customModule="MTMR" customModuleProvider="target" sceneMemberID="viewController">
|
|
||||||
<window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA">
|
|
||||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
|
||||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
|
||||||
<rect key="contentRect" x="196" y="240" width="480" height="270"/>
|
|
||||||
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1028"/>
|
|
||||||
<connections>
|
|
||||||
<outlet property="delegate" destination="B8D-0N-5wS" id="98r-iN-zZc"/>
|
|
||||||
</connections>
|
|
||||||
</window>
|
|
||||||
<connections>
|
|
||||||
<segue destination="XfG-lQ-9wD" kind="relationship" relationship="window.shadowedContentViewController" id="cq2-FE-JQM"/>
|
|
||||||
</connections>
|
|
||||||
</windowController>
|
|
||||||
<customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
|
||||||
</objects>
|
|
||||||
<point key="canvasLocation" x="75" y="250"/>
|
|
||||||
</scene>
|
|
||||||
<!--View Controller-->
|
<!--View Controller-->
|
||||||
<scene sceneID="hIz-AP-VOD">
|
<scene sceneID="hIz-AP-VOD">
|
||||||
<objects>
|
<objects>
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
<plist version="1.0">
|
<plist version="1.0">
|
||||||
<dict>
|
<dict>
|
||||||
|
<key>LSUIElement</key>
|
||||||
|
<true/>
|
||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
|
|||||||
@ -20,12 +20,12 @@ My the idea is to create the program like a platform for plugins for customizati
|
|||||||
- [x] First the weather plugin
|
- [x] First the weather plugin
|
||||||
- [x] 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
|
||||||
- [x] Find how to add haptic feedback
|
- [x] Find how to add haptic feedback
|
||||||
|
- [x] Add icon and menu in StatusBar
|
||||||
|
- [x] Hide from Dock
|
||||||
|
- [x] Status menu: "preferences", "quit"
|
||||||
- [ ] JSON or another approch for save preset and plugins maybe in `~/mtmr`
|
- [ ] JSON or another approch for save preset and plugins maybe in `~/mtmr`
|
||||||
- [ ] Layout: [always left, NSSliderView for center, always right]
|
- [ ] Layout: [always left, NSSliderView for center, always right]
|
||||||
- [ ] Custom buttons size, actions by click in settings
|
- [ ] Custom buttons size, actions by click in settings
|
||||||
- [ ] Add icon and menu in StatusBar
|
|
||||||
- [ ] Hide from Dock
|
|
||||||
- [ ] Status menu: "preferences", "quit"
|
|
||||||
- [ ] System for autoupdate (maybe https://sparkle-project.org/)
|
- [ ] System for autoupdate (maybe https://sparkle-project.org/)
|
||||||
|
|
||||||
Settings:
|
Settings:
|
||||||
|
|||||||
Binary file not shown.
Loading…
Reference in New Issue
Block a user