Przeglądaj źródła

Add status bar icon asset and AI Companion menu entry

Use a custom template-rendered StatusBarIcon so the menu bar item adapts to
light/dark menu bars, and add an AI Companion shortcut to the status menu.

Co-authored-by: Cursor <cursoragent@cursor.com>
huzaifahayat12 2 miesięcy temu
rodzic
commit
dd4072e597

+ 21 - 0
meetings_app/Assets.xcassets/StatusBarIcon.imageset/Contents.json

@@ -0,0 +1,21 @@
+{
+  "images": [
+    {
+      "idiom": "universal",
+      "filename": "StatusBarIcon@1x.png",
+      "scale": "1x"
+    },
+    {
+      "idiom": "universal",
+      "filename": "StatusBarIcon@2x.png",
+      "scale": "2x"
+    }
+  ],
+  "info": {
+    "version": 1,
+    "author": "xcode"
+  },
+  "properties": {
+    "template-rendering-intent": "template"
+  }
+}

BIN
meetings_app/Assets.xcassets/StatusBarIcon.imageset/StatusBarIcon@1x.png


BIN
meetings_app/Assets.xcassets/StatusBarIcon.imageset/StatusBarIcon@2x.png


+ 6 - 1
meetings_app/StatusBar/StatusBarController.swift

@@ -11,7 +11,11 @@ final class StatusBarController: NSObject {
         statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
         super.init()
 
-        if let icon = NSImage(systemSymbolName: "calendar.badge.clock", accessibilityDescription: "Meetings") {
+        if let icon = NSImage(named: "StatusBarIcon") {
+            // Template so the system tints like other menu bar icons (adapts light/dark menu bar).
+            icon.isTemplate = true
+            statusItem.button?.image = icon
+        } else if let icon = NSImage(systemSymbolName: "calendar.badge.clock", accessibilityDescription: "Meetings") {
             icon.isTemplate = true
             statusItem.button?.image = icon
         } else {
@@ -55,6 +59,7 @@ final class StatusBarController: NSObject {
         addOpenSidebarItem(title: "Schedule", pageRaw: 1, to: menu)
         addOpenSidebarItem(title: "Calendar", pageRaw: 2, to: menu)
         addOpenSidebarItem(title: "Widgets", pageRaw: 3, to: menu)
+        addOpenSidebarItem(title: "AI Companion", pageRaw: 5, to: menu)
         addOpenSidebarItem(title: "Settings", pageRaw: 4, to: menu)
 
         let signedIn = authService.loadTokens() != nil