diff --git a/LunaMac.xcodeproj/project.pbxproj b/LunaMac.xcodeproj/project.pbxproj index 5d16aff..7a1b9f0 100644 --- a/LunaMac.xcodeproj/project.pbxproj +++ b/LunaMac.xcodeproj/project.pbxproj @@ -9,6 +9,7 @@ /* Begin PBXBuildFile section */ 7E8188BB28DD423B0080C707 /* InfoBox.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7E8188BA28DD423B0080C707 /* InfoBox.xib */; }; 7E8188BD28DD46900080C707 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7E8188BC28DD46900080C707 /* MainMenu.xib */; }; + 7E96D61628DD75BE00999EAE /* LunaMac.icns in Resources */ = {isa = PBXBuildFile; fileRef = 7E96D61528DD75BE00999EAE /* LunaMac.icns */; }; 7ECD0D7C28DD2A4100B90958 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ECD0D7B28DD2A4100B90958 /* AppDelegate.swift */; }; 7ECD0D7E28DD2A4100B90958 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ECD0D7D28DD2A4100B90958 /* ViewController.swift */; }; 7ECD0D8028DD2A4200B90958 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7ECD0D7F28DD2A4200B90958 /* Assets.xcassets */; }; @@ -18,6 +19,7 @@ /* Begin PBXFileReference section */ 7E8188BA28DD423B0080C707 /* InfoBox.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = InfoBox.xib; sourceTree = ""; }; 7E8188BC28DD46900080C707 /* MainMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainMenu.xib; sourceTree = ""; }; + 7E96D61528DD75BE00999EAE /* LunaMac.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = LunaMac.icns; sourceTree = ""; }; 7ECD0D7828DD2A4100B90958 /* LunaMac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LunaMac.app; sourceTree = BUILT_PRODUCTS_DIR; }; 7ECD0D7B28DD2A4100B90958 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7ECD0D7D28DD2A4100B90958 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; @@ -60,6 +62,7 @@ 7ECD0D7B28DD2A4100B90958 /* AppDelegate.swift */, 7ECD0D7D28DD2A4100B90958 /* ViewController.swift */, 7ECD0D7F28DD2A4200B90958 /* Assets.xcassets */, + 7E96D61528DD75BE00999EAE /* LunaMac.icns */, 7ECD0D8128DD2A4200B90958 /* Main.storyboard */, 7ECD0D8428DD2A4200B90958 /* Info.plist */, 7ECD0D8528DD2A4200B90958 /* LunaMac.entitlements */, @@ -130,6 +133,7 @@ 7E8188BB28DD423B0080C707 /* InfoBox.xib in Resources */, 7ECD0D8028DD2A4200B90958 /* Assets.xcassets in Resources */, 7ECD0D8328DD2A4200B90958 /* Main.storyboard in Resources */, + 7E96D61628DD75BE00999EAE /* LunaMac.icns in Resources */, 7E8188BD28DD46900080C707 /* MainMenu.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/LunaMac.xcodeproj/xcuserdata/claire.xcuserdatad/xcschemes/xcschememanagement.plist b/LunaMac.xcodeproj/xcuserdata/claire.xcuserdatad/xcschemes/xcschememanagement.plist index 7cbe569..cb84d5d 100644 --- a/LunaMac.xcodeproj/xcuserdata/claire.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/LunaMac.xcodeproj/xcuserdata/claire.xcuserdatad/xcschemes/xcschememanagement.plist @@ -10,5 +10,13 @@ 0 + SuppressBuildableAutocreation + + 7ECD0D7728DD2A4100B90958 + + primary + + + diff --git a/LunaMac/AppDelegate.swift b/LunaMac/AppDelegate.swift index 4f65c61..76f1507 100644 --- a/LunaMac/AppDelegate.swift +++ b/LunaMac/AppDelegate.swift @@ -9,6 +9,7 @@ ====== TO DO ======= * auto-update at a set interval * make help menu item work (show the window) + * fix alignment of status bar icon (it's too high) */ import Cocoa @@ -85,13 +86,6 @@ class AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ aNotification: Notification) { updateIcon() - - // try showing the xib dialog - var x = NSWindowController(windowNibName: "InfoBox") - x.loadWindow() - - var m = NSWindowController(windowNibName: "MainMenu") - m.loadWindow() } @objc func buildMenu(key: String = "default") { @@ -121,12 +115,22 @@ class AppDelegate: NSObject, NSApplicationDelegate { ) } + statusBarMenu.addItem(NSMenuItem.separator()) + statusBarMenu.addItem( withTitle: "Update moon phase", action: #selector(AppDelegate.updateIcon), keyEquivalent: "" ) + statusBarMenu.addItem(NSMenuItem.separator()) + + statusBarMenu.addItem( + withTitle: "About LunaMac...", + action: #selector(AppDelegate.showAbout), + keyEquivalent: "" + ) + statusBarMenu.addItem( withTitle: "Quit LunaMac", action: #selector(AppDelegate.quitApp), @@ -134,6 +138,11 @@ class AppDelegate: NSObject, NSApplicationDelegate { ) } + @objc func showAbout() { + let aboutWin = NSWindowController(windowNibName: "InfoBox") + aboutWin.loadWindow() + } + // update menu bar icon @objc func updateIcon() { // current system time in UTC diff --git a/LunaMac/Assets.xcassets/AppIcon.appiconset/Contents.json b/LunaMac/Assets.xcassets/AppIcon.appiconset/Contents.json index 2db2b1c..bb363f6 100644 --- a/LunaMac/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/LunaMac/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,53 +1,63 @@ { "images" : [ { - "idiom" : "mac", "size" : "16x16", + "idiom" : "mac", + "filename" : "fullmoon16.png", "scale" : "1x" }, { - "idiom" : "mac", "size" : "16x16", + "idiom" : "mac", + "filename" : "fullmoon16@2x.png", "scale" : "2x" }, { - "idiom" : "mac", "size" : "32x32", + "idiom" : "mac", + "filename" : "fullmoon32.png", "scale" : "1x" }, { - "idiom" : "mac", "size" : "32x32", + "idiom" : "mac", + "filename" : "fullmoon32@2x.png", "scale" : "2x" }, { - "idiom" : "mac", "size" : "128x128", + "idiom" : "mac", + "filename" : "fullmoon128.png", "scale" : "1x" }, { - "idiom" : "mac", "size" : "128x128", + "idiom" : "mac", + "filename" : "fullmoon128@2x.png", "scale" : "2x" }, { - "idiom" : "mac", "size" : "256x256", + "idiom" : "mac", + "filename" : "fullmoon256.png", "scale" : "1x" }, { - "idiom" : "mac", "size" : "256x256", + "idiom" : "mac", + "filename" : "fullmoon256@2x.png", "scale" : "2x" }, { - "idiom" : "mac", "size" : "512x512", + "idiom" : "mac", + "filename" : "fullmoon512.png", "scale" : "1x" }, { - "idiom" : "mac", "size" : "512x512", + "idiom" : "mac", + "filename" : "fullmoon512@2x.png", "scale" : "2x" } ], diff --git a/LunaMac/Base.lproj/Main.storyboard b/LunaMac/Base.lproj/Main.storyboard index 895f4ab..8859d09 100644 --- a/LunaMac/Base.lproj/Main.storyboard +++ b/LunaMac/Base.lproj/Main.storyboard @@ -21,32 +21,40 @@ - - +