Skip to content

Commit c3bc01c

Browse files
committed
feat(mac): create and use monochrome menu bar icon
1 parent d018fd2 commit c3bc01c

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

Mac/CarpeCast-Swift/ContentView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -469,10 +469,10 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {
469469
func applicationDidFinishLaunching(_ notification: Notification) {
470470
statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)
471471
if let button = statusItem.button {
472-
let appIcon = NSImage(named: "AppIcon") ?? NSImage(named: NSImage.applicationIconName)
473-
if let icon = appIcon?.copy() as? NSImage {
474-
icon.size = NSSize(width: 18, height: 18)
475-
button.image = icon
472+
if let menuBarIcon = NSImage(named: "MenuBarIcon") {
473+
menuBarIcon.isTemplate = true
474+
menuBarIcon.size = NSSize(width: 18, height: 18)
475+
button.image = menuBarIcon
476476
} else {
477477
button.image = NSImage(systemSymbolName: "play.circle", accessibilityDescription: "CarpeCast")
478478
button.image?.isTemplate = true
941 Bytes
Loading

Mac/build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ cp -R "$BUILD_DIR/mediaremote-adapter/build/MediaRemoteAdapter.framework" "$APP_
4343
cp "$BUILD_DIR/mediaremote-adapter/bin/mediaremote-adapter.pl" "$MACOS_DIR/mediaremote-adapter.pl"
4444
chmod +x "$MACOS_DIR/mediaremote-adapter.pl"
4545

46-
# Copy Info.plist
46+
# Copy Info.plist and resources
4747
cp "$SRC_DIR/Info.plist" "$APP_BUNDLE/Contents/Info.plist"
48+
cp "$SRC_DIR/MenuBarIcon.png" "$RESOURCES_DIR/" || true
4849

4950
# Create PkgInfo
5051
echo -n "APPL????" > "$APP_BUNDLE/Contents/PkgInfo"

0 commit comments

Comments
 (0)