diff --git a/README.md b/README.md index d7dc381..361f8ec 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ The picker works offline with 1,870 emoji from [gemoji v4.1.0](https://github.co ## System theme -Search for **Toggle System Theme** (try `theme` or `system`) and press Return to switch macOS from light to dark appearance or back. Selecting it in the launcher dismisses Conjure on success. Its global shortcut runs in the background without presenting a window or changing the current launcher view. You can favorite it or assign a shortcut in Settings; existing theme keybindings and favorites survive the rename. +Search for **Toggle System Theme**, identified by its centered 🌗 icon (try `theme` or `system`), and press Return to switch macOS from light to dark appearance or back. Selecting it in the launcher dismisses Conjure on success. Its global shortcut runs in the background without presenting a window or changing the current launcher view. You can favorite it or assign a shortcut in Settings; existing theme keybindings and favorites survive the rename. The first use may ask permission to control **System Events**. Allow it under **System Settings → Privacy & Security → Automation → Conjure**. If permission is denied or macOS reports an error, Conjure shows the failure in the visible launcher or a standalone alert when the launcher is hidden. Conjure's own launcher keeps its existing dark styling. diff --git a/Sources/Conjure/LauncherWindowController.swift b/Sources/Conjure/LauncherWindowController.swift index 130bd86..1d49610 100644 --- a/Sources/Conjure/LauncherWindowController.swift +++ b/Sources/Conjure/LauncherWindowController.swift @@ -45,6 +45,7 @@ final class LauncherWindowController: NSWindowController, NSWindowDelegate, NSSe private static let emojiIcon = makeEmojiIcon("🤔") private static let notesIcon = makeEmojiIcon("📔") private static let translateIcon = makeEmojiIcon("🌏") + private static let themeIcon = makeEmojiIcon("🌗") private static func makeEmojiIcon(_ emoji: String) -> NSImage { let text = NSAttributedString(string: emoji, attributes: [.font: NSFont.systemFont(ofSize: 28)]) @@ -566,13 +567,13 @@ final class LauncherWindowController: NSWindowController, NSWindowDelegate, NSSe cell.imageView?.image = Self.notesIcon cell.toolTip = "Write notes with Markdown and images" case .toggleTheme: - cell.imageView?.image = NSImage(systemSymbolName: "circle.lefthalf.filled", accessibilityDescription: nil) + cell.imageView?.image = Self.themeIcon cell.toolTip = "Switch macOS between light and dark appearance" default: cell.imageView?.image = Self.translateIcon cell.toolTip = "Translate English to Japanese" } - cell.imageView?.contentTintColor = entry.command == .toggleTheme ? SunsetPalette.accent : nil + cell.imageView?.contentTintColor = nil } else { let application = results[row] cell.textField?.stringValue = application.name diff --git a/Tests/ConjureKitTests/EmojiIconTests.swift b/Tests/ConjureKitTests/EmojiIconTests.swift index f95a6b7..8efa76a 100644 --- a/Tests/ConjureKitTests/EmojiIconTests.swift +++ b/Tests/ConjureKitTests/EmojiIconTests.swift @@ -2,7 +2,7 @@ import AppKit import Testing @testable import Conjure -@Test(arguments: ["emoji", "notes", "translate"]) +@Test(arguments: ["emoji", "notes", "translate", "theme"]) @MainActor func commandArtworkHasBalancedVisiblePadding(query: String) throws { _ = NSApplication.shared let launcher = LauncherWindowController()